php-lab / event
Event dispatcher.
dev-master
2016-03-07 21:45 UTC
Requires
- php: >=7.0
This package is auto-updated.
Last update: 2024-12-22 20:21:18 UTC
README
PhpLab\Event requires PHP 7.
Usage
use PhpLab\Event\Dispatcher; use App\Logger; $this->app = new Dispatcher(); $logger = new Logger(); $this->app->subscribe('payment.error', 'logger', function () use ($logger) { $logger->log('error', 'Payment error'); }); $this->app->dispatch('payment.error');
License
PhpLab\Event is licensed under the MIT license.