Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,15 @@ settings is configured.

For more details, see :doc:`/forms`.

.. _reference-form-field-name:

field_name
..........

**type**: ``string`` **default**: ``_token``

This is the field name that you should give to the CSRF token field of your forms.

.. _reference-framework-csrf-protection:

csrf_protection
Expand All @@ -357,14 +366,14 @@ can also :ref:`disable CSRF protection on individual forms <form-csrf-customizat
.. configuration-block::

.. code-block:: yaml

# config/packages/framework.yaml
framework:
# ...
csrf_protection: true

.. code-block:: xml

<!-- config/packages/framework.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
Expand All @@ -378,9 +387,9 @@ can also :ref:`disable CSRF protection on individual forms <form-csrf-customizat
<framework:csrf-protection enabled="true"/>
</framework:config>
</container>

.. code-block:: php

// config/packages/framework.php
use Symfony\Config\FrameworkConfig;
return static function (FrameworkConfig $framework) {
Expand Down