jowy/silex-pimple-aware-event-dispatcher

Silex Pimple Aware Symfony Event Dispatcher

v1.0.0 2015-03-29 05:22 UTC

This package is not auto-updated.

Last update: 2024-12-21 17:59:04 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