Download the PHP package ashleydawson/domain-event-dispatcher-bundle without Composer
On this page you can find all versions of the php package ashleydawson/domain-event-dispatcher-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ashleydawson/domain-event-dispatcher-bundle
More information about ashleydawson/domain-event-dispatcher-bundle
Files in ashleydawson/domain-event-dispatcher-bundle
Package domain-event-dispatcher-bundle
Short Description Symfony bundle to add the domain event dispatcher (singleton)
License MIT
Informations about the package domain-event-dispatcher-bundle
Domain Event Dispatcher Bundle
Brings the domain event dispatcher (singleton) to Symfony projects. For full usage instructions, please see the full documentation shipped with the library.
Installation
Install the bundle via Composer:
Then, register the bundle with the Symfony kernel app/AppKernel.php
:
Configuration
Deferred events are
configured to be dispatched from the Symfony kernel.terminate
kernel event. To change this, add the following to
your app/config/config.yml
file:
Usage
Please refer to the full documentation for an in-depth look at how to use the domain event dispatcher. However, please find a simple example below:
Create an event:
Create a listener:
Add the listener to the event dispatcher via the Symfony Dependency Injection Container
using the tag ashley_dawson.domain_event_listener
:
Dispatch an event from your model:
Symfony Profiler
The map of events that have been deferred/dispatched during a request can be found in the Symfony Profiler. Simply click on the domain events icon and the profile screen containing the map will be displayed.
Toolbar Info:
Full Profiler Screen:
All versions of domain-event-dispatcher-bundle with dependencies
symfony/symfony Version ^2.3|^3.0
ashleydawson/domain-event-dispatcher Version ^1.0.6