updated eventdispatcher
This commit is contained in:
@ -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
|
||||
---------
|
||||
|
Reference in New Issue
Block a user