Skip to content

Commit fc24a02

Browse files
Feriklxabbuh
authored andcommitted
Update form.rst
1 parent ed81ff5 commit fc24a02

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/form.rst

+7
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ the CSRF generator and validated when binding the form.
156156

157157
$csrfStorage = new NativeSessionTokenStorage();
158158
// ...
159+
160+
.. tip::
161+
If you want to disable CSRF on your form, you can give specific options to your form builder through the createBuilder() function:
162+
163+
use Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType
164+
165+
$form = $formFactory->createBuilder(FormType::class, null, ['csrf_protection' => false])
159166

160167
Twig Templating
161168
~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)