Bachir Soussi Chiadmi ad38015ea9 first commit : grave core and admin plugin | 9 anni fa | |
---|---|---|
.. | ||
Debug | 9 anni fa | |
DependencyInjection | 9 anni fa | |
Tests | 9 anni fa | |
CHANGELOG.md | 9 anni fa | |
ContainerAwareEventDispatcher.php | 9 anni fa | |
Event.php | 9 anni fa | |
EventDispatcher.php | 9 anni fa | |
EventDispatcherInterface.php | 9 anni fa | |
EventSubscriberInterface.php | 9 anni fa | |
GenericEvent.php | 9 anni fa | |
ImmutableEventDispatcher.php | 9 anni fa | |
LICENSE | 9 anni fa | |
README.md | 9 anni fa | |
composer.json | 9 anni fa | |
phpunit.xml.dist | 9 anni fa |
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