Skip to content

Provides tools that allow your application components to communicate with each other by dispatching events and listening to them

License

Notifications You must be signed in to change notification settings

symfony/event-dispatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fe30c87 · Dec 22, 2014
Jul 9, 2012
Dec 22, 2014
Jul 21, 2013
Jul 19, 2012
Dec 22, 2014
Dec 22, 2014
Dec 7, 2014
Nov 30, 2014
Dec 7, 2014
Dec 22, 2014
Dec 22, 2014
Jan 7, 2014
Nov 24, 2014
Dec 15, 2014
Dec 18, 2014

Repository files navigation

EventDispatcher Component

The Symfony EventDispatcher component implements the Mediator pattern in a simple and effective way to make your projects truly extensible.

use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\Event;

$dispatcher = new EventDispatcher();

$dispatcher->addListener('event_name', function (Event $event) {
    // ...
});

$dispatcher->dispatch('event_name');

Resources

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/EventDispatcher/
$ composer.phar install
$ phpunit