The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

Versions:

Getting Started

Usage

Extra Utilities

Usage

Step 1: Create an event dispatcher

use League\Event\EventDispatcher;

$dispatcher = new EventDispatcher();

For more information about setting up the dispatcher, view the documentation about dispatcher setup.

Step 2: Subscribe to an event

Listeners can subscribe to events with the dispatcher.

$dispatcher->subscribeTo($eventIdentifier, $listener);

For more information about subscribing, view the documentation about subscribing to events.

Step 3: Dispatch an event

Events can be dispatched by the dispatcher.

$dispatcher->dispatch($event);

For more information about dispatching, view the documentation about dispatching events.