WPZylos Events
PSR-14 compliant event dispatcher for WPZylos framework.
What You Get
- EventDispatcher — PSR-14 compliant dispatcher
- Event Classes — Type-safe event objects
- Listeners — Single event handlers
- Subscribers — Multi-event handler classes
- Stoppable Events — Control event propagation
Quick Start
use WPZylos\Framework\Events\EventDispatcher;
use WPZylos\Framework\Events\ListenerProvider;
$provider = new ListenerProvider();
$dispatcher = new EventDispatcher($provider);
// Register listener on the provider
$provider->addListener(UserCreated::class, function (UserCreated $event) {
// Handle event
});
// Dispatch event through the dispatcher
$dispatcher->dispatch(new UserCreated($user));
Documentation
- Overview — Architecture and design
- Installation — Requirements and setup
- Usage — Core patterns
- Configuration — Config options
- API Reference — Class documentation
- Examples — Code samples
- Testing — Event testing
- Security — Security considerations
- Troubleshooting — Common issues
Related Packages
- wpzylos-core — Application foundation
- wpzylos-hooks — WordPress hooks