我正在建立一个移动应用程序通过webservices与我的symfony2应用程序交谈我无法找到一种方法来禁用特定控制器/操作上的csrf保护
我想将注册数据发布到此操作并使用sf2表单验证.我不会在我的移动应用程序中调用该表单
无法更改操作中的容器参数,因为它是冻结参数而抛出异常...
我不想为整个应用程序禁用表单保护
任何线索?
谢谢 !
更新:使用symfony 2.1.x
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'csrf_protection' => false,
));
}
Run Code Online (Sandbox Code Playgroud)