Événement — PHP Event Dispatcher

Événement is a very simple event dispatching library for PHP. It has the same design goals as Silex and Pimple, to empower the user while staying concise and simple.

Concise indeed. At the core it’s a tad above 50 lines of codes.

Listening for events:

$emitter->on('user.created', function (User $user) use ($logger) {
    $logger->log(sprintf("User '%s' was created.", $user->getLogin()));
});

Dispatching events:

$emitter->emit('user.created', array($user));

Événement →

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.