summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/plugin-hooks.markdown8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/plugin-hooks.markdown b/doc/plugin-hooks.markdown
index a700e34b..97816d5f 100644
--- a/doc/plugin-hooks.markdown
+++ b/doc/plugin-hooks.markdown
@@ -161,6 +161,14 @@ $this->template->hook->attach('template:dashboard:sidebar', 'myplugin:dashboard/
));
```
+Example to attach a template with a callable:
+
+```php
+$this->template->hook->attach('template:dashboard:sidebar', 'myplugin:dashboard/sidebar', function($hook_param1, $hook_param2) {
+ return array('new_template_variable' => 'foobar'); // Inject a new variable into the plugin template
+});
+```
+
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.