Download the PHP package activecollab/eventsdispatcher without Composer
On this page you can find all versions of the php package activecollab/eventsdispatcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download activecollab/eventsdispatcher
More information about activecollab/eventsdispatcher
Files in activecollab/eventsdispatcher
Download activecollab/eventsdispatcher
More information about activecollab/eventsdispatcher
Files in activecollab/eventsdispatcher
Vendor activecollab
Package eventsdispatcher
Short Description Dispatch events, and provide event handlers
License MIT
Package eventsdispatcher
Short Description Dispatch events, and provide event handlers
License MIT
Please rate this library. Is it a good library?
Informations about the package eventsdispatcher
EventsDispatcher
This package offers simple events dispatcher, with listeners. Key concepts:
- Events are not arbitrary strings, but instances that encapsulate all relevant event data,
- When you specify a listener, you specify an event class (or interface) that you want to listen to,
- You can listen to entire classes of events, by specifying general enough event class (or interface),
- Listeners are callables, and event is always passed to it as the first (and only) argument.
General listener example:
To specify a global listener, that handles all events, just go highly general with the specification:
Similar approach can be used to handle a class of events. Instead of using the base EventInterface
, register listener to a class, or interface that all events of a targeted type extend, or implement.
To trigger an event, call trigger()
method with event as the first (and only) argument:
All versions of eventsdispatcher with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1
The package activecollab/eventsdispatcher contains the following files
Loading the files please wait ....