EventEmitter
Adds system event related features to any class.
Tags
Table of Contents
- fireSystemEvent() : mixed
- Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.
- fireViewEvent() : string
- Special event function used for extending within view files, allowing HTML to be injected multiple times.
Methods
fireSystemEvent()
Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.
public
fireSystemEvent(string $event[, array<string|int, mixed> $params = [] ][, bool $halt = true ]) : mixed
For example:
$this->fireSystemEvent('backend.list.myEvent', ['my value']);
Is equivalent to:
$this->fireEvent('list.myEvent', ['myvalue'], true);
Event::fire('backend.list.myEvent', [$this, 'myvalue'], true);
Parameters
- $event : string
-
Event name
- $params : array<string|int, mixed> = []
-
Event parameters
- $halt : bool = true
-
Halt after first non-null result
Return values
mixed —fireViewEvent()
Special event function used for extending within view files, allowing HTML to be injected multiple times.
public
fireViewEvent(string $event[, array<string|int, mixed> $params = [] ]) : string
For example:
= $this->fireViewEvent('backend.auth.extendSigninView') ?>Parameters
- $event : string
-
Event name
- $params : array<string|int, mixed> = []
-
Event parameters