diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-13 18:08:46 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-13 18:08:46 -0400 |
commit | 2ebe8b32728c341ec16e1197fe2e12d32ddd5de5 (patch) | |
tree | 164455e08b993d958a7466abbb00c439b0edacbb /doc | |
parent | ffe61abc6910670c5c2c243eb82d9f5851f06c6b (diff) |
Add the possibility to attach template hooks with local variables
Diffstat (limited to 'doc')
-rw-r--r-- | doc/plugin-hooks.markdown | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/plugin-hooks.markdown b/doc/plugin-hooks.markdown index 9a4bdab2..a700e34b 100644 --- a/doc/plugin-hooks.markdown +++ b/doc/plugin-hooks.markdown @@ -153,6 +153,14 @@ Example to add new content in the dashboard sidebar: $this->template->hook->attach('template:dashboard:sidebar', 'myplugin:dashboard/sidebar'); ``` +Example to attach a template with local variables: + +```php +$this->template->hook->attach('template:dashboard:sidebar', 'myplugin:dashboard/sidebar', array( + 'variable' => 'foobar', +)); +``` + This call is usually defined in the `initialize()` method. The first argument is name of the hook and the second argument is the template name. |