File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
cookbook/event_dispatcher Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ magic ``__call()`` method in the class you want to be extended like this:
17
17
{
18
18
// create an event named 'foo.method_is_not_found'
19
19
$event = new HandleUndefinedMethodEvent($this, $method, $arguments);
20
- $this->dispatcher->dispatch($this, 'foo.method_is_not_found', $event);
20
+ $this->dispatcher->dispatch('foo.method_is_not_found', $event);
21
21
22
22
// no listener was able to process the event? The method does not exist
23
23
if (!$event->isProcessed()) {
@@ -122,4 +122,4 @@ instance of ``Bar`` with the ``foo.method_is_not_found`` event:
122
122
.. code-block :: php
123
123
124
124
$bar = new Bar();
125
- $dispatcher->addListener('foo.method_is_not_found', $bar);
125
+ $dispatcher->addListener('foo.method_is_not_found', array( $bar, 'onFooMethodIsNotFound') );
You can’t perform that action at this time.
0 commit comments