public function EventDispatcher::addListener in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/event-dispatcher/EventDispatcher.php \Symfony\Component\EventDispatcher\EventDispatcher::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)
Overrides EventDispatcherInterface::addListener
2 calls to EventDispatcher::addListener()
- ContainerAwareEventDispatcher::lazyLoad in vendor/
symfony/ event-dispatcher/ ContainerAwareEventDispatcher.php - Lazily loads listeners for this event from the dependency injection container.
- EventDispatcher::addSubscriber in vendor/
symfony/ event-dispatcher/ EventDispatcher.php - Adds an event subscriber.
File
- vendor/
symfony/ event-dispatcher/ EventDispatcher.php, line 89
Class
- EventDispatcher
- The EventDispatcherInterface is the central point of Symfony's event listener system.
Namespace
Symfony\Component\EventDispatcherCode
public function addListener($eventName, $listener, $priority = 0) {
$this->listeners[$eventName][$priority][] = $listener;
unset($this->sorted[$eventName]);
}