benvens/event

PSR-14 event manager implementation library for PHP

1.0.0 2017-09-28 20:39 UTC

This package is not auto-updated.

Last update: 2021-11-22 21:46:00 UTC


README

Build Status

Implementation of PSR-14 Event Manager.

Requirements

PHP >= 7.1

Installation

composer require benvens/event

Usage example

$manager = new EventManager();
$manager->attach('posts.create', function(EventInterface $event) {
    echo "Post {$event->getParam('title')} was created";
});
$event = new Event('posts.create', $this, ['title' => 'Lorem ipsum']);
$manager->trigger('posts.create');