ListenerAcceptorInterface
in
Table of Contents
Constants
Methods
- addListener() : $this
- Add a listener for an event.
- addOneTimeListener() : $this
- Add a one time listener for an event.
Constants
P_HIGH
High priority.
public
mixed
P_HIGH
= 100
Tags
P_LOW
Low priority.
public
mixed
P_LOW
= -100
Tags
P_NORMAL
Normal priority.
public
mixed
P_NORMAL
= 0
Tags
Methods
addListener()
Add a listener for an event.
public
addListener(string $event, ListenerInterface|callable $listener[, int $priority = self::P_NORMAL ]) : $this
The first parameter should be the event name, and the second should be the event listener. It may implement the League\Event\ListenerInterface or simply be "callable". In this case, the priority emitter also accepts an optional third parameter specifying the priority as an integer. You may use one of our predefined constants here if you want.
Parameters
- $event : string
- $listener : ListenerInterface|callable
- $priority : int = self::P_NORMAL
Return values
$thisaddOneTimeListener()
Add a one time listener for an event.
public
addOneTimeListener(string $event, ListenerInterface|callable $listener[, int $priority = self::P_NORMAL ]) : $this
The first parameter should be the event name, and the second should be the event listener. It may implement the League\Event\ListenerInterface or simply be "callable".
Parameters
- $event : string
- $listener : ListenerInterface|callable
- $priority : int = self::P_NORMAL