Skip to content
Événement is a very simple event dispatching library for PHP.
PHP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src/Evenement
tests
vendor/symfony/Component
.gitmodules
LICENSE
README.md
composer.json
phpunit.xml.dist

README.md

Événement

Événement is a very simple event dispatching library for PHP 5.3.

It has the same design goals as Silex and Pimple, to empower the user while staying concise and simple.

It is very strongly inspired by the EventEmitter API found in node.js.

Creating an Emitter

<?php
require __DIR__.'/vendor/evenement/src/Evenement/EventEmitter.php';
$emitter = new Evenement\EventEmitter();

Adding Listeners

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

Emitting Events

<?php
$emitter->emit('user.create', array($user));
Something went wrong with that request. Please try again.