Line 24:
Line 24:
$hookmanager->initHooks() takes 1 parameter (an array of contexts) and activate the hooks management for this script:
$hookmanager->initHooks() takes 1 parameter (an array of contexts) and activate the hooks management for this script:
−
- ''''context'''' is the module's context as a string. This is simply a indicator that hooking functions can use to detect which modules they want to hook (several different modules can have the same hooks names, but a hooking function may want to hook only one specific module and not the others).
+
- ''''context'''' is a context string. This is simply a indicator that hooking functions can use to detect in which context they are called.
−
−
Note: you can set several contexts in the same script (for example if you want to break the functionnalities of your script into smaller parts, or if you are mixing several modules into one, for example when you do a bridge between modules or third-party application).
+
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 deidcated to your page).