Event Class
package | Fuel |
---|---|
category | Core |
author | Eric Barnes |
author | Harro "WanWizard" Verton |
__construct(array $events)
array
events array
has_events(string $event) : bool
Checks if the event has listeners
string
The name of the event
bool
Whether the event has listenersregister() : void
Registers a Callback for a given event
trigger(string $event, mixed $data, string $return_type, boolean $reversed) : mixed
Triggers an event and returns the results. The results can be returned in the following formats:
'array' 'json' 'serialized' 'string'
string
The name of the event
mixed
Any data that is to be passed to the listener
string
The return type
boolean
Whether to fire events ordered LIFO instead of FIFO
mixed
The return of the listeners, in the return typeunregister(string $event, mixed $callback) : boolean
string
event to remove from
mixed
callback to remove [optional, null for all]
boolean
whether one or all callbacks have been removed_format_return(array $calls, string $return_type) : mixed
Formats the return in the given type
array
The array of returns
string
The return type
mixed
The formatted return$_events : array