There is no license information available for the latest version (3.0) of this package.

A Symfony compatible event dispatcher that allows services to be lazy loaded from an instance of the Pimple DI container

3.0 2018-02-23 08:26 UTC

This package is not auto-updated.

Last update: 2024-06-16 06:33:43 UTC


Pimple Aware Event Dispatcher


composer.phar require "davedevelopment/pimple-aware-event-dispatcher:*@dev"


To use in a Silex application:


use PimpleAwareEventDispatcher\PimpleAwareEventDispatcher;
use Silex\Application;
use Symfony\Component\EventDispatcher\EventDispatcher;

$app = new Application;

// define the dispatcher
$app['event_dispatcher'] = function () use ($app) {
    $dispatcher = new EventDispatcher();
    return new PimpleAwareEventDispatcher($dispatcher, $app);

// define our application services
$app['some.service'] = function() use ($app) {
    // let's assume this takes a bit of doing and/or is dependant on several other
    // services
    return new SomeService;

// add a listener, that will lazily fetch the service when needed
    array("some.service", "serviceMethod")