File tree 1 file changed +9
-6
lines changed
components/http_foundation
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -147,25 +147,28 @@ exist::
147
147
// the query string is '?foo=bar'
148
148
149
149
$request->query->get('foo');
150
- // returns bar
150
+ // returns ' bar'
151
151
152
152
$request->query->get('bar');
153
153
// returns null
154
154
155
- $request->query->get('bar', 'bar ');
156
- // returns 'bar '
155
+ $request->query->get('bar', 'baz ');
156
+ // returns 'baz '
157
157
158
158
When PHP imports the request query, it handles request parameters like
159
159
``foo[bar]=bar `` in a special way as it creates an array. So you can get the
160
160
``foo `` parameter and you will get back an array with a ``bar `` element::
161
161
162
- // the query string is '?foo[bar]=bar '
162
+ // the query string is '?foo[bar]=baz '
163
163
164
164
$request->query->get('foo');
165
- // returns array('bar' => 'bar')
165
+ // returns array('bar' => 'baz')
166
+
167
+ $request->query->get('foo[bar]');
168
+ // returns null
166
169
167
170
$request->query->get('foo')['bar'];
168
- // returns 'bar '
171
+ // returns 'baz '
169
172
170
173
.. _component-foundation-attributes :
171
174
You can’t perform that action at this time.
0 commit comments