Hooks system: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
{{TemplateDocDevEn}}
{{TemplateDocDevEn}}


= Introduction =
Hooks is a developer feature, available with Dolibarr 3.2 and more, to allow developer to add personalized code into Dolibarr core code with no need to patch Dolibarr.
Hooks is a developer feature, available with Dolibarr 3.2 and more, to allow developer to add personalized code into Dolibarr core code with no need to patch Dolibarr.
On the contrary to the [[triggers]] (another feature to interact with Dolibarr code) which are by definition linked to a business action, hooks can happen anywhere at anytime, they are entry points into the program.
On the contrary to the [[triggers]] (another feature to interact with Dolibarr code) which are by definition linked to a business action, hooks can happen anywhere at anytime, they are entry points into the program.
Line 7: Line 8:


= Implementation =
= Implementation =
To implement a hook in your own module (so that your module can be ''hooked'' by others), you have two steps to follow.
To implement a hook in your own module (so that your module can be ''hooked'' by others), you have two steps to follow.