File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
components/http_foundation Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -147,25 +147,28 @@ exist::
147147 // the query string is '?foo=bar'
148148
149149 $request->query->get('foo');
150- // returns bar
150+ // returns ' bar'
151151
152152 $request->query->get('bar');
153153 // returns null
154154
155- $request->query->get('bar', 'bar ');
156- // returns 'bar '
155+ $request->query->get('bar', 'baz ');
156+ // returns 'baz '
157157
158158When PHP imports the request query, it handles request parameters like
159159``foo[bar]=bar `` in a special way as it creates an array. So you can get the
160160``foo `` parameter and you will get back an array with a ``bar `` element::
161161
162- // the query string is '?foo[bar]=bar '
162+ // the query string is '?foo[bar]=baz '
163163
164164 $request->query->get('foo');
165- // returns array('bar' => 'bar')
165+ // returns array('bar' => 'baz')
166+
167+ $request->query->get('foo[bar]');
168+ // returns null
166169
167170 $request->query->get('foo')['bar'];
168- // returns 'bar '
171+ // returns 'baz '
169172
170173.. _component-foundation-attributes :
171174
You can’t perform that action at this time.
0 commit comments