]> git.immae.eu Git - github/wallabag/wallabag.git/blame - vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md
gitignore vendor
[github/wallabag/wallabag.git] / vendor / symfony / event-dispatcher / Symfony / Component / EventDispatcher / README.md
CommitLineData
4f5b44bd
NL
1EventDispatcher Component
2=========================
3
4EventDispatcher implements a lightweight version of the Observer design
5pattern.
6
7 use Symfony\Component\EventDispatcher\EventDispatcher;
8 use Symfony\Component\EventDispatcher\Event;
9
10 $dispatcher = new EventDispatcher();
11
12 $dispatcher->addListener('event_name', function (Event $event) {
13 // ...
14 });
15
16 $dispatcher->dispatch('event_name');
17
18Resources
19---------
20
21You can run the unit tests with the following command:
22
23 $ cd path/to/Symfony/Component/EventDispatcher/
24 $ composer.phar install --dev
25 $ phpunit