frankhildebrandt / pimple-serviceaware-eventdispatcher
Eventdispatcher which knows pimple services
Installs: 3 176
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 2
Requires
- pimple/pimple: 3.*
- symfony/event-dispatcher: 2.5.*
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2025-01-14 05:16:07 UTC
README
The PimpleAwareEventDispatcher extends the original Symfony2 EventDispatcher with the ability to consume Pimple Services as EventListener. This gives your application the ability to lazy-instantiate its EventListeners.
Usage
use Fhild\Pimple\EventDispatcher\PimpleAwareEventDispatcher
$container = new Container();
$container['someservice'] = function() {
return new SomeService();
};
$dispatcher = new PimpleAwareEventDispatcher($container);
$dispatcher->addListener("my.event", "someservice:onTest");
$event = $dispatcher->dispatch("my.event");