Skip to content

Commit ea1dea0

Browse files
committed
Documented the new csrf_token field prefix
1 parent 8a5f600 commit ea1dea0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

security/csrf.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ this can be customized on a form-by-form basis::
108108
// ...
109109
}
110110

111+
You can also customize the rendering of the CSRF form field creating a custom
112+
:doc:`form theme </form/form_themes>` and using ``csrf_token`` as the prefix of
113+
the field (e.g. define ``{% block csrf_token_widget %} ... {% endblock %}`` to
114+
customize the entire form field contents).
115+
116+
.. versionadded:: 4.3
117+
118+
The ``csrf_token`` form field prefix was introduced in Symfony 4.3.
119+
111120
CSRF Protection in Login Forms
112121
------------------------------
113122

0 commit comments

Comments
 (0)