From 9e59e571fc3ebe11df1d31382393bc3f58180605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Walter=20Nu=C3=B1ez?= Date: Tue, 28 Dec 2021 12:25:00 -0500 Subject: [PATCH] Update Doc of csrf_protection configuration in framework level --- reference/configuration/framework.rst | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) 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