innmind / event-bus-bundle
Event Bus Bundle
Installs: 115
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
pkg:composer/innmind/event-bus-bundle
Requires
- php: ~7.1
- innmind/event-bus: ~2.0
- symfony/config: ~3.0
- symfony/dependency-injection: ~3.0
- symfony/http-kernel: ~3.0
- symfony/yaml: ~3.0
Requires (Dev)
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2022-02-01 13:00:09 UTC
README
master |
develop |
---|---|
Symfony integration of innmind/event-bus
that ease stacking event buses.
Installation
composer require innmind/event-bus-bundle
In your AppKernel.php
add the following line:
//app/AppKernel.php class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Innmind\EventBusBundle\InnmindEventBusBundle, ); // ... } // ... }
Usage
$container->get('innmind_event_bus')->dispatch(new MyEvent);
In order to dispatch your events you need to define the listeners as services with the tag innmind_event_bus.listener
with the attribte listen_to
that will contain the command FQCN.