Event Class
| package | Fuel |
|---|---|
| category | Core |
| author | Eric Barnes |
| author | Harro "WanWizard" Verton |
__construct(array $events)
arrayevents array
has_events(string $event) : bool
Checks if the event has listeners
stringThe name of the event
boolWhether 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'
stringThe name of the event
mixedAny data that is to be passed to the listener
stringThe return type
booleanWhether to fire events ordered LIFO instead of FIFO
mixedThe return of the listeners, in the return typeunregister(string $event, mixed $callback) : boolean
stringevent to remove from
mixedcallback to remove [optional, null for all]
booleanwhether one or all callbacks have been removed_format_return(array $calls, string $return_type) : mixed
Formats the return in the given type
arrayThe array of returns
stringThe return type
mixedThe formatted return$_events : array