bind()
bind(callable $function, integer $precedence) : void
Assigns new hook for a given action
Optional precedence may be assigned.
Parameters
callable | $function | |
integer | $precedence | (default: 0) |
Defines an Action hook.
An action hook passes the result of each action to the subsequent one, allowing for a sequential transformation from one value to another. Because of this, the callbacks associated with action hooks must accept one parameter, perform any transformation to be made to the parameter, and return its transformed result.
trigger(mixed $value, mixed $precedence = null) : mixed
Invokes all hooks of a given precedence for a given event.
If null precedence is provided, invokes all hooks for a given event, regardless of precedence.
mixed | $value | The value to be transformed. |
mixed | $precedence | (default: null) If provided, only callbacks of this precedence will be executed. |