Skip to content

Commit 47c336a

Browse files
committed
fixed event dispatcher doc
1 parent 5d9a9ba commit 47c336a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

guides/event/overview.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,9 @@ The event object has several methods to get the event data:
7777

7878
* ``getSubject()``: Gets the subject object attached to the event;
7979

80-
* ``getParameters()``: Returns the event parameters.
80+
* ``get()``: Gets the value of a parameter;
8181

82-
The event object can also be accessed as an array to get its parameters::
83-
84-
echo $event['culture'];
82+
* ``all()``: Returns the event parameters.
8583

8684
The Dispatcher
8785
--------------

guides/event/recipes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Then, create a class that will host the listener::
114114
public function addBarMethodToFoo(Event $event)
115115
{
116116
// we only want to respond to the calls to the 'bar' method
117-
if ('bar' != $event['method']) {
117+
if ('bar' != $event->get('method']) {
118118
// allow another listener to take care of this unknown method
119119
return false;
120120
}
@@ -123,7 +123,7 @@ Then, create a class that will host the listener::
123123
$foo = $event->getSubject();
124124

125125
// the bar method arguments
126-
$arguments = $event['parameters'];
126+
$arguments = $event->get('parameters');
127127

128128
// do something
129129
// ...

0 commit comments

Comments
 (0)