Download the PHP package fyre/event without Composer
On this page you can find all versions of the php package fyre/event. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package event
FyreEvent
FyreEvent is a free, open-source events library for PHP.
Table Of Contents
- Installation
- Basic Usage
- Methods
- Events
- Event Listeners
- Event Dispatchers
Installation
Using Composer
In PHP:
Basic Usage
$parentEventManager
is an EventManager that will handle propagated events, and will default to null.
Methods
Add Listener
Add an EventListener.
$eventListener
is an EventListener.
Clear
Clear all events.
Dispatch
Dispatch an Event.
$event
is an Event.
Has
Check if an event exists.
$name
is a string representing the event name.
Off
Remove event(s).
$name
is a string representing the event name.$callback
is the callback to remove.
If the $callback
argument is omitted, all events will be removed instead.
On
Add an event.
$name
is a string representing the event name.$callback
is the callback to execute.$priority
is a number representing the callback priority, and will default to EventManager::PRIORITY_NORMAL.
Remove Listener
Remove an EventListener.
$eventListener
is an EventListener.
Trigger
Trigger an event.
$name
is a string representing the event name.
Any additional arguments supplied will be passed to the event callback.
Events
$name
is a string representing the name of the Event .$subject
is an object representing the Event subject, and will default to null.$data
is an array containing the Event data, and will default to [].$cancelable
is a boolean indicating whether the event can be cancelled, and will default to true.
Get Data
Get the Event data.
Get Name
Get the Event name.
Get Result
Get the Event result.
Get Subject
Get the Event subject.
Is Default Prevented
Determine whether the default Event should occur.
Is Propagation Stopped
Determine whether the Event propagation was stopped.
Is Stopped
Determine whether the Event was stopped.
Prevent Default
Prevent the default Event.
Set Data
$data
is an array containing the Event data.
Set Result
$result
is the Event result.
Stop Immediate Propagation
Stop the Event propagating immediately.
Stop Propagation
Stop the Event propagating.
Event Listeners
Custom event listeners can be created by implementing the Fyre\Event\EventListenerInterface
, ensuring all below methods are implemented.
Implemented Events
Get the implemented events.
Event Dispatchers
Custom event dispatchers can be created by using the Fyre\Event\EventDispatcherTrait
.
Dispatch Event
Dispatch an Event.
$name
is a string representing the event name.$data
is an array containing the Event data, and will default to [].$subject
is an object representing the Event subject, and will default to the event dispatcher.$cancelable
is a boolean indicating whether the event can be cancelled, and will default to true.
Get Event Manager
Get the EventManager.
Set Event Manager
Set the EventManager.
$eventManager
is an EventManager.