diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-13 14:23:53 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-13 14:23:53 -0400 |
commit | 4ffaba2ba0dd6b5810adea1916080c3b645f3d29 (patch) | |
tree | 7c216830af0f97b0c0908d63be83698cabba3922 /doc | |
parent | 29820bf83b7ee18b5f48990ce0188a9c041c3473 (diff) |
Add reference hooks
Diffstat (limited to 'doc')
-rw-r--r-- | doc/plugin-hooks.markdown | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/plugin-hooks.markdown b/doc/plugin-hooks.markdown index 787c62df..5e01e93a 100644 --- a/doc/plugin-hooks.markdown +++ b/doc/plugin-hooks.markdown @@ -115,6 +115,31 @@ List of asset Hooks: - `template:layout:css` - `template:layout:js` + +Reference hooks +--------------- + +Reference hooks are passing a variable by reference. + +Example: + +```php +$this->hook->on('formatter:board:query', function (\PicoDb\Table &query) { + $query->eq('color_id', 'red'); +}); +``` + +The code above will show only tasks in red on the board. + +List of reference hooks: + +| Hook | Description | +|--------------------------------------------|---------------------------------------------------------------| +| `formatter:board:query` | Alter database query before rendering board | +| `pagination:dashboard:task:query` | Alter database query for tasks pagination on the dashboard | +| `pagination:dashboard:subtask:query` | Alter database query for subtasks pagination on the dashboard | + + Template Hooks -------------- |