Closed
Description
components/event_dispatcher/introduction.rst
find "Registering Event Listeners in the Service Container"
there are peace of code
// register the event dispatcher service
$containerBuilder->register(
'event_dispatcher',
'Symfony\Component\EventDispatcher\EventDispatcher'
);
this does not work because needs ContainerAwareEventDispatcher.
This code works.
$listener->addArgument($containerBuilder);
$this->_builder->setDefinition(
'event_dispatcher',
$listener
);