Topics

Class Dispatcher

Event dispatcher class

Namespace: Ip

Methods:

__construct( )
addEventListener( string $name , string $callable , [ integer $priority = 50 ] )

Register event listener

Parameters:

string $name Event name
string $callable Callable method name. This method is called on specified event.
integer $priority Event priority. Lower number means higher priority.
addFilterListener( string $name , callable $callable , [ integer $priority = 50 ] )

Register filter listener

Parameters:

string $name Filter name
callable $callable Method name. This method is called on specified event.
integer $priority Filter priority. Lower number means higher priority.
addJobListener( string $name , callable $callable , [ integer $priority = 50 ] )

Register job listener

Parameters:

string $name job name
callable $callable method name. This method is called by specified job.
integer $priority . Lower number means higher priority. Only the job with highest priority is processed.
bindSlot( string $slot , string $callable , [ integer $priority = 50 ] )

Bind to a slot generation event

Parameters:

string $slot Slot name
string $callable Callable method
integer $priority Filter priority. Lower number means higher priority.

Throws:

Ip\Exception
mixed filter( string $eventName , mixed $value , [ array $data = array() ] )

Filter a value

Parameters:

string $eventName filter Event name
mixed $value Data for filtering
array $data Additional information which may be used for filter processing

Return values:

mixed
mixed|null job( mixed $eventName , [ array $data = array() ] )

Execute a job

Parameters:

mixed $eventName
array $data

Return values:

mixed|null
mixed|null slot( mixed $eventName , [ array $data = array() ] )

Render slot

Parameters:

mixed $eventName
array $data

Return values:

mixed|null
null event( string $eventName , [ array $data = array() ] )

Trigger an event

Parameters:

string $eventName Event name
array $data Data for event processing

Return values:

null
comments powered by Disqus