jowy / silex-pimple-aware-event-dispatcher
Silex Pimple Aware Symfony Event Dispatcher
v1.0.0
2015-03-29 05:22 UTC
Requires
- php: >=5.5
- pimple/pimple: ~3.0
- symfony/event-dispatcher: ~2.6
This package is not auto-updated.
Last update: 2024-11-09 17:30:06 UTC
README
Replace silex default event dispatcher with pimple aware event dispatcher
Requirements
- PHP >= 5.5
- Pimple >= 3.0
Installation
composer require jowy/silex-pimple-aware-event-dispatcher
Usage
$app = new Application(); $app->register(new PimpleAwareEventDispatcherServiceProvider()); // register listener in DIC $app["key"] = function () { return new TestListener(); }; // register service locator id and method $app["dispatcher"]->addListenerService("some.event", ["key", "method"]); // dispatch event $app["dispatcher"]->dispatch("some.event", new Event());
License
MIT, see LICENSE