pclib
3.0.0
Lightweight PHP framework
|
Event manager provides possibility to register event listeners and trigger events. More...
Inherits IService.
Public Member Functions | |
add ($name, callable $fn, $target=null) | |
Attach function $fn to event $name. | |
remove ($name, $target=null) | |
Remove listeners from event $name. | |
on ($name, $fn, $target=null) | |
Attach function $fn to event $name. | |
attached ($name, $target=null) | |
Will return array of listeners, attached to event $name. | |
trigger ($name, array $data=[], $target=null) | |
Trigger event $name. | |
Protected Attributes | |
$listeners = [] | |
Array of listeners - store all attached event callbacks. | |
Event manager provides possibility to register event listeners and trigger events.