Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 08d44d7d845ef8a4bb2f78e5e120823b > files > 7

php-symfony2-EventDispatcher-2.2.10-1.fc18.noarch.rpm

EventDispatcher Component
=========================

EventDispatcher implements a lightweight version of the Observer design
pattern.

    use Symfony\Component\EventDispatcher\EventDispatcher;
    use Symfony\Component\EventDispatcher\Event;

    $dispatcher = new EventDispatcher();

    $dispatcher->addListener('event_name', function (Event $event) {
        // ...
    });

    $dispatcher->dispatch('event_name');

Resources
---------

You can run the unit tests with the following command:

    $ cd path/to/Symfony/Component/EventDispatcher/
    $ composer.phar install
    $ phpunit