How do you impliment a hook system in a PHP application to change the code before or after it executes. How would the basic architecture of a hookloader class be for a PHP CMS (or even a simple application). How then could this be extended into a full plugins/modules loader?
(Also, are there any books or tutorials on a CMS hook system?)
Here's another solution:
Creating a hook
Run this wherever you want to create a hook:
x_do_action('header_scripts');
Attach a function to the hook
Then attach a function to the above by doing:
Global variable to store all hooks/events
Add this to the top of your main PHP functions file, or equivalent
Base functions
You can build an events system as simple or complex as you want it.
Add an event
Then call it like this
Or remove all callbacks for that event like this