updated eventdispatcher

This commit is contained in:
kremsy
2015-01-19 11:11:45 +01:00
parent 0ca7d2dd15
commit f97109a75b
18 changed files with 123 additions and 426 deletions

View File

@ -1,19 +1,21 @@
EventDispatcher Component
=========================
The Symfony2 EventDispatcher component implements the Mediator pattern in a
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;
```php
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\Event;
$dispatcher = new EventDispatcher();
$dispatcher = new EventDispatcher();
$dispatcher->addListener('event_name', function (Event $event) {
// ...
});
$dispatcher->addListener('event_name', function (Event $event) {
// ...
});
$dispatcher->dispatch('event_name');
$dispatcher->dispatch('event_name');
```
Resources
---------