pclib  3.0.0
Lightweight PHP framework
Public Member Functions | Protected Attributes
EventManager Class Reference

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.
 

Detailed Description

Event manager provides possibility to register event listeners and trigger events.


The documentation for this class was generated from the following file: