You are here

public function EventDispatcherInterface::addListener in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/event-dispatcher/EventDispatcherInterface.php \Symfony\Component\EventDispatcher\EventDispatcherInterface::addListener()

Adds an event listener that listens on the specified events.

Parameters

string $eventName The event to listen on:

callable $listener The listener:

int $priority The higher this value, the earlier an event: listener will be triggered in the chain (defaults to 0)

4 methods override EventDispatcherInterface::addListener()
ContainerAwareEventDispatcher::addListener in core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php
Adds an event listener that listens on the specified events.
EventDispatcher::addListener in vendor/symfony/event-dispatcher/EventDispatcher.php
Adds an event listener that listens on the specified events.
ImmutableEventDispatcher::addListener in vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php
Adds an event listener that listens on the specified events.
TraceableEventDispatcher::addListener in vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
Adds an event listener that listens on the specified events.

File

vendor/symfony/event-dispatcher/EventDispatcherInterface.php, line 44

Class

EventDispatcherInterface
The EventDispatcherInterface is the central point of Symfony's event listener system. Listeners are registered on the manager and events are dispatched through the manager.

Namespace

Symfony\Component\EventDispatcher

Code

public function addListener($eventName, $listener, $priority = 0);