Bachir Soussi Chiadmi ad38015ea9 first commit : grave core and admin plugin | il y a 9 ans | |
---|---|---|
.. | ||
Debug | il y a 9 ans | |
DependencyInjection | il y a 9 ans | |
Tests | il y a 9 ans | |
CHANGELOG.md | il y a 9 ans | |
ContainerAwareEventDispatcher.php | il y a 9 ans | |
Event.php | il y a 9 ans | |
EventDispatcher.php | il y a 9 ans | |
EventDispatcherInterface.php | il y a 9 ans | |
EventSubscriberInterface.php | il y a 9 ans | |
GenericEvent.php | il y a 9 ans | |
ImmutableEventDispatcher.php | il y a 9 ans | |
LICENSE | il y a 9 ans | |
README.md | il y a 9 ans | |
composer.json | il y a 9 ans | |
phpunit.xml.dist | il y a 9 ans |
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');
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/EventDispatcher/
$ composer install
$ phpunit