Trigger
Controls and keeps track of all of the Triggers and events.
Summary
| Trigger | Controls and keeps track of all of the Triggers and events. |
| Variables | |
| $priorities | Custom prioritized callbacks. |
| $called | Keeps track of called Triggers. |
| $exists | Caches trigger exist states. |
| Functions | |
| cmp | Sorts actions by priority when used with usort. |
| call | Calls a trigger, passing any additional arguments to it. |
| filter | Filters a variable through a trigger’s actions. Similar to call, except this is stackable and is intended to modify something instead of inject code. |
| remove | Unregisters a given $action from a $trigger. |
| exists | Checks if there are any actions for a given $trigger. |
| current | Returns a singleton reference to the current class. |
filter
| public function filter( | & | $target, | |
| $name | ) |
Filters a variable through a trigger’s actions. Similar to call, except this is stackable and is intended to modify something instead of inject code.
Any additional arguments passed to this function are passed to the function being called.
Parameters
| $target | The variable to filter. |
| $name | The name of the trigger. |
Returns
$target, filtered through any/all actions for the trigger $name.