$hooks
$hooks : array
The registered hooks
The Hook class
This class is used by the core to trigger event with custom callbacks.
registerHook(callback $callback) : \Orpheus\Hook\Hook
Register a new callback for this hook.
callback | $callback | A callback. |
create(string $name) : \Orpheus\Hook\Hook
Create new Hook
string | $name | The new hook name. |
The new hook.
register(string $name, callback $callback) : \Orpheus\Hook\Hook
Register a callback
string | $name | The hook name. |
callback | $callback | The new callback. |
Add the callback to those of the hook.
trigger(string $name, boolean $silent = false) : \Orpheus\Hook\The
Trigger a hook by name
string | $name | The hook name. |
boolean | $silent | Make it silent, no exception thrown. Default value is false. |
triggerHook() result, usually the first parameter.
Trigger the hook named $name. e.g trigger('MyHook', true, $parameter1); trigger('MyHook', $parameter1, $parameter2); We advise to always provide $silent parameters if you pass additional parameters to the callback