Download the PHP package berlioz/event-manager without Composer
On this page you can find all versions of the php package berlioz/event-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download berlioz/event-manager
More information about berlioz/event-manager
Files in berlioz/event-manager
Package event-manager
Short Description PHP event manager/dispatcher, respecting PSR-14 (Event Dispatcher) standard.
License MIT
Homepage https://getberlioz.com
Informations about the package event-manager
Berlioz Event Manager
Berlioz Event Manager is a PHP event manager/dispatcher, respecting PSR-14 (Event Dispatcher) standard.
For more information, and use of Berlioz Framework, go to website and online documentation : https://getberlioz.com
Installation
Composer
You can install Berlioz Event Manager with Composer, it's the recommended installation.
Dependencies
- PHP ^8.0
- Packages:
- psr/event-dispatcher
Usage
Dispatcher
To initialize the event dispatcher:
To listen an event:
To dispatch an event:
Priority
You can define a priority in your listeners. The highest priority is in the first executions.
The priority argument is an integer ; you can so define your priority with integer value instead of constant.
Add delegate dispatcher
You can delegate dispatch to another dispatcher who respects PSR-14. The delegated dispatchers are called after, only if event isn't stopped.
Add listener provider
You can add listener providers. Providers are called in the order of addition.
Default listener
The default listener is \Berlioz\EventManager\Listener\Listener
. You can define your own default provider, he must
implement \Berlioz\EventManager\Listener\ListenerInterface
interface.
To declare this into the dispatcher: