31,003
edits
m (→Introduction) |
|||
| Line 5: | Line 5: | ||
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. | ||
* Hooks work by context (ie the module, eg: "productcard" for products, "invoicecard" for invoices, etc..). It's easy to find them, just search for "'''initHooks('''" into php files. | * Hooks work by context (ie the module, eg: "productcard" for products, "invoicecard" for invoices, etc..). It's easy to find them, just search for "'''initHooks('''" into php files. | ||
* Hooks are | * Hooks are part of code that can be completed or replaced with your own code. You can find all hookable part of code by searching for "'''executeHooks('''". | ||
= Add a hook to allow to insert code = | = Add a hook to allow to insert code = | ||