czproject/events

Events manager.

v1.0.0 2018-03-21 12:40 UTC

README

Build Status

Events manager.

Become a Patron! Buy me a coffee

Installation

Download a latest package or use Composer:

composer require czproject/events

CzProject\Events requires PHP 5.4.0 or later.

Usage

<?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/