@@ -135,7 +135,7 @@ A call to the dispatcher's ``addListener()`` method associates any valid
135
135
PHP callable to an event::
136
136
137
137
$listener = new AcmeListener();
138
- $dispatcher->addListener('acme.action', array($listener, 'onFooAction'));
138
+ $dispatcher->addListener('acme.foo. action', array($listener, 'onFooAction'));
139
139
140
140
The ``addListener() `` method takes up to three arguments:
141
141
@@ -161,12 +161,12 @@ The ``addListener()`` method takes up to three arguments:
161
161
162
162
use Symfony\Component\EventDispatcher\Event;
163
163
164
- $dispatcher->addListener('foo.action', function (Event $event) {
165
- // will be executed when the foo.action event is dispatched
164
+ $dispatcher->addListener('acme. foo.action', function (Event $event) {
165
+ // will be executed when the acme. foo.action event is dispatched
166
166
});
167
167
168
168
Once a listener is registered with the dispatcher, it waits until the event
169
- is notified. In the above example, when the ``foo.action `` event is dispatched,
169
+ is notified. In the above example, when the ``acme. foo.action `` event is dispatched,
170
170
the dispatcher calls the ``AcmeListener::onFooAction() `` method and passes
171
171
the ``Event `` object as the single argument::
172
172
@@ -216,7 +216,7 @@ determine which instance is passed.
216
216
// register your event listener service
217
217
$listener = new Definition(\AcmeListener::class);
218
218
$listener->addTag('kernel.event_listener', array(
219
- 'event' => 'foo.action',
219
+ 'event' => 'acme. foo.action',
220
220
'method' => 'onFooAction',
221
221
));
222
222
$containerBuilder->setDefinition('listener_service_id', $listener);
0 commit comments