Hooks system: Difference between revisions

Jump to navigation Jump to search
added modulecontext
(Adding implementation of a hook)
(added modulecontext)
Line 18: Line 18:
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
$hookmanager=new HookManager($db);
$hookmanager=new HookManager($db);
$hookmanager->initHooks(array('actioncard'));
$hookmanager->initHooks(array('modulecontext'));
</source>
</source>
''''modulecontext'''' 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).


2- Place hooks wherever you want in your script:
2- Place hooks wherever you want in your script:
439

edits

Navigation menu