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