Reputation: 237
I'm writing a RequestListener and I look like to get the EventDispatcher. It was working on previous version of Symfony. I checked the CHANGELOG.md :
The method getListenerPriority($eventName, $listener) has been added to the EventDispatcherInterface. The methods Event::setDispatcher(), Event::getDispatcher(), Event::setName() and Event::getName() have been removed. The event dispatcher and the event name are passed to the listener call.
public function onKernelRequest(GetResponseEvent $event) {
$dispatcher = $event->getDispatcher();
}
How can I get the event dispatcher ?
Thanks
Upvotes: 0
Views: 250
Reputation: 48893
public function onKernelRequest(
GetResponseEvent $event,
$eventName,
EventDispatcherInterface $dispatcher)
{
}
Upvotes: 4