Skip to content

Commit

Permalink
Removed doc about getting original parameter value from ParameterBag
Browse files Browse the repository at this point in the history
  • Loading branch information
edefimov authored and xabbuh committed Jan 18, 2016
1 parent 61a4ae4 commit 1e1ecc4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,15 @@ exist::

When PHP imports the request query, it handles request parameters like
``foo[bar]=bar`` in a special way as it creates an array. So you can get the
``foo`` parameter and you will get back an array with a ``bar`` element. But
sometimes, you might want to get the value for the "original" parameter name:
``foo[bar]``. This is possible with all the ``ParameterBag`` getters like
:method:`Symfony\\Component\\HttpFoundation\\Request::get` via the third
argument::
``foo`` parameter and you will get back an array with a ``bar`` element::

// the query string is '?foo[bar]=bar'

$request->query->get('foo');
// returns array('bar' => 'bar')

$request->query->get('foo[bar]');
// returns null

$request->query->get('foo[bar]', null, true);
// returns 'bar'
// returns null

.. _component-foundation-attributes:

Expand Down

0 comments on commit 1e1ecc4

Please sign in to comment.