toandp / events
A simple PHP event system
v1.0.1
2019-10-09 04:00 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2025-04-09 17:05:20 UTC
README
PHP tdp/di A simple PHP event system
The EventEmitter is a simple pattern that allows you to create an object that emits events, and allow you to listen to those events.
Install
composer require toandp/events
Simple example
require_once './vendor/autoload.php'; // composer autoload.php // Get needed classes use tdp\events\EventManager; $eManager = new EventManager(); // Simple $eManager->on('create', function () { echo "Something action"; }); // Just do it! $eManager->trigger('create');
License
MIT