Re: Comparing Hooks
Reply #2 –
Remember Elk also has several "generic" hooks which allow you to act on almost every action and subaction ... a few that I use are:
call_integration_hook('integrate_action_' . $hook . '_before', array($this->_function_name));
call_integration_hook('integrate_action_' . $hook . '_after', array($this->_function_name));
call_integration_hook('integrate_sa_' . $this->_name, array(&$subactions));
call_integration_hook('integrate_list_' . $listOptions['id'], array(&$listOptions));
The first two are in the Site Dispatcher, allowing you to act both before and after an action is initiated. One minor thing to note and something that is being worked on, is the _after hook is not always guaranteed to fire ... for example an action with an exit / die / fatal etc inside of it. So pretty much anywhere a ?action=xyz is called, these hooks are called.
The third is in the Action.class allowing you integrate before a sub-action is called from a controller. This allows you to easily add your own subActions to a controller, or simply act / trigger at the start of any subAction. So wherever you see $action->initialize() in a controller, that hook is being called (~55 times)
The last is called wherever you see a createList(); call, it allows you to add / modify to any list / form that gets displayed, this is super useful as we really implemented createList (~170 times)