Basic event manager for BEdita. More...
|bind ($eventName, $listener)|
|Attaches a listener to an event. |
|unbind ($eventName=null, $listener=null)|
|Detaches a listener from an event. |
|trigger ($eventName, array $eventData=array())|
|Triggers a new event, calling all listeners binded to that event in the order they were added. |
|$listeners = array()|
Basic event manager for BEdita.
Attaches a listener to an event.
Listeners can be either anonymous functions or pairs of class name / method name (`ClassRegistryinit()` will be used in this case to retreive object instance).
|string||$eventName Name of the event to be listened.|
|mixed||$listener Callback or full qualified name of listener.|
|array $|| eventData = |
Triggers a new event, calling all listeners binded to that event in the order they were added.
Passing data as an array will result in callbacks associated to the triggered event being called with array elements as arguments in the order they appear in that array (as of `call_user_func_array()`). In addition to that, the `$event` object will be passed to those callbacks as *last* argument, thus allowing listeners to gain control on event propagation or modifying the event itself.
|string||$eventName Name of the event to be triggered.|
|array||$eventData Data of the event.|
|BeCallbackManager::unbind||(||$|| eventName =
|$|| listener = |
Detaches a listener from an event.
If `$eventName` is `null`, the given `$listener` will be detached from any event it was attached to. If `$listener` is `null`, all listeners binded to the given `$eventName` will be detached from that event. If both parameters are empty, each end every listener is cleared from any event.
|string||$eventName Name of the event to be unbinded.|
|mixed||$listener Callback or full qualified name of callback.|