Events manager.
Download a latest package or use Composer:
composer require czproject/events
CzProject\Events requires PHP 5.4.0 or later.
<?php
$events = new CzProject\Events\Events(array(
'click',
'before-delete',
));
$events->addHandler('click', function () {
// ...
});
$events->addHandler('before-delete', function (Entity\Post $post) {
// ...
});
$events->fireEvent('click');
$events->fireEvent('before-delete', $post);
License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/