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
May 5, 2015
Jan 16, 2015
Apr 20, 2015
Jul 21, 2013
Dec 28, 2013
May 5, 2015
Jan 5, 2015
May 5, 2015
Nov 30, 2014
Dec 7, 2014
Jan 8, 2015
May 5, 2015
Jan 1, 2015
Feb 8, 2015
Apr 24, 2015
Feb 18, 2015

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 install
$ phpunit