Skip to content

Commit e640a25

Browse files
committed
minor #16321 documentation is incomplete the variable form._token is missing (arcanisgk)
This PR was submitted for the 6.0 branch but it was merged into the 4.4 branch instead. Discussion ---------- documentation is incomplete the variable form._token is missing documentation is incomplete the variable form._token is missing: https://symfony.com/doc/current/form/form_customization.html#form-variables-reference external resource: https://stackoverflow.com/a/23455805/17161735 Commits ------- 6857f24 Warn about the _token field added automatically
2 parents eabddbd + 6857f24 commit e640a25

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

form/form_customization.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ control over how each form field is rendered, so you can fully customize them:
7474
</div>
7575
</div>
7676

77+
.. caution::
78+
79+
If you're rendering each field manually, make sure you don't forget the
80+
``_token`` field that is automatically added for CSRF protection.
81+
82+
You can also use ``{{ form_rest(form) }}`` (recommended) to render any
83+
fields that aren't rendered manually. See
84+
:ref:`the form_rest() documentation <reference-forms-twig-rest>` below for
85+
more information.
86+
7787
.. note::
7888

7989
Later in this article you can find the full reference of these Twig

0 commit comments

Comments
 (0)