Symfony\Component\Form\FormConfiguration::enableDefaultCsrfProtection PHP Метод

enableDefaultCsrfProtection() публичный статический Метод

Enables CSRF protection for all new forms
public static enableDefaultCsrfProtection ( )
    static public function enableDefaultCsrfProtection()
    {
        self::$defaultCsrfProtection = true;
    }

Usage Example

 /**
  * Boots the Bundle.
  */
 public function boot()
 {
     if ($this->container->has('error_handler')) {
         $this->container->get('error_handler');
     }
     if ($this->container->hasParameter('csrf_secret')) {
         FormConfiguration::setDefaultCsrfSecret($this->container->getParameter('csrf_secret'));
         FormConfiguration::enableDefaultCsrfProtection();
     }
 }
All Usage Examples Of Symfony\Component\Form\FormConfiguration::enableDefaultCsrfProtection