J
J
JohnxFFF2019-11-19 12:48:24
Yii
JohnxFFF, 2019-11-19 12:48:24

How to implement a hook system?

It is necessary to transfer data from different modules to one module, that is, to collect some information.
Examples:
1) There is a "Menu" module, and each module adds its own items to it, then the Menu is rendered.
2) There is a "Settings" module, and any module can add some data (html for example) to the module page
How to implement this?
Suggestions:
Through Bootstrap in modules?
Through events + callback?
But how to make the menu build under certain conditions, for example, on a certain page, etc.?
So that extra code does not hang out, bootsrap / extra events and handlers, etc. are not executed once again

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question