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