I have a CRUD controller on Symfony 2. I want to make a backbone application wrapper for this controller. But in the logic of the application there is a question: "How to implement CSRF protection for the backbone forms application?"
I see a few ways:
I will be glad for your help in choosing the right solution to the problem.
I'm sorry, I hurried to the question.
Here is the solution
From myself I want to add the solution to Symfony server side:
$options=array();
if ($request->isXmlHttpRequest() )
$options['csrf_protection']= false;
$form = $this->createForm(new FormType(), $entity,$options);