Skip to content

Commit d96fcfe

Browse files
committed
Minor tweak
1 parent 2160a0d commit d96fcfe

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

reference/configuration/framework.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,20 +354,14 @@ enabled
354354
This option can be used to disable CSRF protection on *all* forms. But you
355355
can also :ref:`disable CSRF protection on individual forms <form-csrf-customization>`.
356356

357-
If you're using forms, but want to avoid starting your session (e.g. using
358-
forms in an API-only website), ``csrf_protection`` will need to be set to
359-
``false``.
360-
361-
example:
362-
363357
.. configuration-block::
364358

365359
.. code-block:: yaml
366360
367361
# config/packages/framework.yaml
368362
framework:
369363
# ...
370-
csrf_protection: true #can be true or false
364+
csrf_protection: true
371365
372366
.. code-block:: xml
373367
@@ -391,10 +385,14 @@ example:
391385
use Symfony\Config\FrameworkConfig;
392386
return static function (FrameworkConfig $framework) {
393387
$framework->csrfProtection()
394-
->enabled(true) #can be true or false
388+
->enabled(true)
395389
;
396390
};
397391
392+
If you're using forms, but want to avoid starting your session (e.g. using
393+
forms in an API-only website), ``csrf_protection`` will need to be set to
394+
``false``.
395+
398396
.. _config-framework-error_controller:
399397

400398
error_controller

0 commit comments

Comments
 (0)