Installation
Requirements and setup for WPZylos Events.
Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.0 |
Composer Installation
composer require KYNetCode/wpzylos-events
Service Provider Registration
Register the events service provider in your plugin:
use WPZylos\Framework\Events\EventServiceProvider;
$app->register(new EventServiceProvider());
Container Access
// Get dispatcher from container
$dispatcher = $app->get(EventDispatcher::class);
$dispatcher = $app->get('events');
Verification
After installation, verify events are working:
$dispatcher = $app->get('events');
$dispatcher->listen('test', function ($event) {
error_log('Event received: ' . get_class($event));
});
$dispatcher->dispatch(new class {});