Symfony\Component\Form\FormConfiguration::setDefaultCsrfSecret PHP Method

setDefaultCsrfSecret() public static method

Sets the CSRF secret used in all new CSRF protected forms
public static setDefaultCsrfSecret ( string $secret )
$secret string
    static public function setDefaultCsrfSecret($secret)
    {
        self::$defaultCsrfSecret = $secret;
    }

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::setDefaultCsrfSecret