Hooks system: Difference between revisions

Jump to navigation Jump to search
m
Tag: 2017 source edit
Tag: 2017 source edit
Line 49: Line 49:
</syntaxHighlight>
</syntaxHighlight>


$hookmanager->initHooks() takes 1 parameter (an array of contexts) and activates the hooks management for this script. '<nowiki/>'''context'''' is a context string. This is simply a indicator that hooking functions can use, to detect in which context they are called.
$hookmanager->initHooks() takes 1 parameter (an array of contexts) and activates the hooks management for this script. '<nowiki/>'''context'''' is a context string. This is simply a indicator that hooking functions can use, to detect in which context they are called. Note that the context 'all' is always valid.


Note: you can set several contexts in the same init (for example if you want to have a common context into several pages and want also a specific context dedicated to your page).
Note: you can set several contexts in the same init (for example if you want to have a common context into several pages and want also a specific context dedicated to your page).

Navigation menu