diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 4feb8fcd56d..93084385b3c 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -358,6 +358,43 @@ If you're using forms, but want to avoid starting your session (e.g. using forms in an API-only website), ``csrf_protection`` will need to be set to ``false``. +example: + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/framework.yaml + framework: + # ... + csrf_protection: true #can be true or false + + .. code-block:: xml + + + + + + + + + + .. code-block:: php + + // config/packages/framework.php + use Symfony\Config\FrameworkConfig; + return static function (FrameworkConfig $framework) { + $framework->csrfProtection() + ->enabled(true) #can be true or false + ; + }; + .. _config-framework-error_controller: error_controller