class dispatcher extends EventDispatcher implements dispatcher_interface

Extension of the Symfony EventDispatcher

It provides an additional trigger_event method, which gives some syntactic sugar for dispatching events. Instead of creating the event object, the method will do that for you.

Example:

$vars = array('page_title');
extract($phpbb_dispatcher->trigger_event('core.index', compact($vars)));

Properties

protected bool $disabled

Methods

mixed
trigger_event(string $eventName, array $data = [])

Construct and dispatch an event

object
dispatch(object $event, string $eventName = null)

{@inheritdoc}

disable()

Disable the event dispatcher.

enable()

Enable the event dispatcher.

Details

at line 42
mixed trigger_event(string $eventName, array $data = [])

Construct and dispatch an event

Parameters

string $eventName

The event name

array $data

An array containing the variables sending with the event

Return Value

mixed

at line 55
object dispatch(object $event, string $eventName = null)

{@inheritdoc}

Parameters

object $event
string $eventName

Return Value

object

at line 68
disable()

Disable the event dispatcher.

at line 76
enable()

Enable the event dispatcher.