Skip to content

components/event_dispatcher/introduction not working code #4235

Closed
@kozloffsky

Description

@kozloffsky

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
    );

Metadata

Metadata

Assignees

No one assigned

    Labels

    EventDispatcheractionableClear and specific issues ready for anyone to take them.buggood first issueIdeal for your first contribution! (some Symfony experience may be required)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions