File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,9 @@ The event object has several methods to get the event data:
77
77
78
78
* ``getSubject() ``: Gets the subject object attached to the event;
79
79
80
- * ``getParameters () ``: Returns the event parameters.
80
+ * ``get () ``: Gets the value of a parameter;
81
81
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.
85
83
86
84
The Dispatcher
87
85
--------------
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ Then, create a class that will host the listener::
114
114
public function addBarMethodToFoo(Event $event)
115
115
{
116
116
// we only want to respond to the calls to the 'bar' method
117
- if ('bar' != $event[ 'method']) {
117
+ if ('bar' != $event->get( 'method']) {
118
118
// allow another listener to take care of this unknown method
119
119
return false;
120
120
}
@@ -123,7 +123,7 @@ Then, create a class that will host the listener::
123
123
$foo = $event->getSubject();
124
124
125
125
// the bar method arguments
126
- $arguments = $event[ 'parameters'] ;
126
+ $arguments = $event->get( 'parameters') ;
127
127
128
128
// do something
129
129
// ...
You can’t perform that action at this time.
0 commit comments