8000 Added tip for accessing values via request object. · GromNaN/symfony-docs@7f0fbaa · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f0fbaa

Browse files
committed
Added tip for accessing values via request object.
1 parent aba1a9f commit 7f0fbaa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

book/forms.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,13 @@ an array. In this example, since ``$defaultData`` is not an object (and
13611361
no ``data_class`` option is set), ``$form->getData()`` ultimately returns
13621362
an array.
13631363

1364+
.. tip::
1365+
You can also access the values a form submits (in this case "name") directly
1366+
through the request object, like so:
1367+
1368+
.. code-block:: php
1369+
$this->get('request')->request->get('name');
1370+
13641371
Adding Validation
13651372
~~~~~~~~~~~~~~~~~
13661373

0 commit comments

Comments
 (0)
0