Пример #1
0
 /**
  * Boots the Bundle.
  */
 public function boot()
 {
     if ($this->container->hasParameter('csrf_secret')) {
         Form::setDefaultCsrfSecret($this->container->getParameter('csrf_secret'));
         Form::enableDefaultCsrfProtection();
     }
 }
Пример #2
0
 public function testDefaultCsrfProtectionCanBeEnabled()
 {
     Form::enableDefaultCsrfProtection();
     $form = new Form('author', new Author(), $this->validator);
     $this->assertTrue($form->isCsrfProtected());
 }