From 38a709216ee3e1ac6293e38db92cef9901854dc8 Mon Sep 17 00:00:00 2001 From: Pavel Bezdverniy Date: Wed, 24 Oct 2018 10:57:36 +0300 Subject: [PATCH 1/2] Update form.rst Add example how to disable CSRF in Form --- components/form.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/form.rst b/components/form.rst index a02d67491b2..c24eca24c1b 100644 --- a/components/form.rst +++ b/components/form.rst @@ -153,6 +153,13 @@ the CSRF generator and validated when binding the form. $csrfStorage = new NativeSessionTokenStorage(); // ... + +.. tip:: + If you want to disable CSRF on your form, you can give specific options to your form builder through the createBuilder() function.: + + use Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType + + $form = $formFactory->createBuilder(FormType::class, null, ['csrf_protection' => false]) Twig Templating ~~~~~~~~~~~~~~~ From 3a90ebb2f56468e3e33d274f9e73596f7bbdd349 Mon Sep 17 00:00:00 2001 From: Pavel Bezdverniy Date: Wed, 24 Oct 2018 11:09:55 +0300 Subject: [PATCH 2/2] Update form.rst Change typo due to PR review --- components/form.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/form.rst b/components/form.rst index c24eca24c1b..9973531f9f5 100644 --- a/components/form.rst +++ b/components/form.rst @@ -155,7 +155,7 @@ the CSRF generator and validated when binding the form. // ... .. tip:: - If you want to disable CSRF on your form, you can give specific options to your form builder through the createBuilder() function.: + If you want to disable CSRF on your form, you can give specific options to your form builder through the createBuilder() function: use Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType