Category Archives: disable

Symfony2: disable CSRF protection on form

$document = new Document(); $form = $this->createFormBuilder($document, array(‘csrf_protection’ => false)) ->add(‘name’) ->add(‘file’) ->getForm(); if ($this->getRequest()->getMethod() === ‘POST’) { $form-bindRequest($this->getRequest()); //validation form if ($form->Valid()) { …..  It’s easy ūüėČ

Posted in CSRF, disable, form, Symfony2 | Leave a comment