| API | Package | Subpackage | Class | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Event |
JEventDispatcher |
JEventDispatcher |
Never | Work in Progress |
Class to handle dispatching events.
| Method | Description |
|---|---|
__construct | Constructor |
getInstance | Returns a reference to the global Event Dispatcher object, only creating it if it doesn’t already exist. |
register | Registers an event handler to the event dispatcher |
trigger | Triggers an event by dispatching arguments to all observers that handle the event and returning their return values. |
An event represents the non-UI side of a command which are registered with the Event Dispatcher by the application or an extension. The name of the event to be registered can be freely choosen at design time, but is typically named on followed by the name of some action being performed or a status set by the Observable object.
The Observable furnishes the context where its events occur and configures the Dispatcher with data from properties declared by the action and to inform all Observers. When the Observable triggers the events during its life-cycle, the Observer’s update() method is invoked to do the real work.