Skip to content

praswicaksono/silex-pimple-aware-event-dispatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silex Pimple Aware Event Dispatcher

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

About

Silex Pimple Aware Symfony Event Dispatcher

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages