setDefaultCsrfFieldName() 공개 정적인 메소드

Sets the CSRF field name used in all new CSRF protected forms
public static setDefaultCsrfFieldName ( string $name )
$name string The CSRF field name
예제 #1
0
파일: FormTest.php 프로젝트: spf13/symfony
 public function testDefaultCsrfFieldNameCanBeSet()
 {
     FormConfiguration::setDefaultCsrfFieldName('foobar');
     $form = new Form('author', new Author(), $this->validator);
     $form->enableCsrfProtection();
     $this->assertEquals('foobar', $form->getCsrfFieldName());
 }