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

isDefaultCsrfProtectionEnabled() public static method

Checks if Csrf protection for all forms is enabled.
public static isDefaultCsrfProtectionEnabled ( )
    static public function isDefaultCsrfProtectionEnabled()
    {
        return self::$defaultCsrfProtection;
    }

Usage Example

Beispiel #1
0
 /**
  * Constructor.
  *
  * @param string $name
  * @param array|object $data
  * @param ValidatorInterface $validator
  * @param array $options
  */
 public function __construct($name, $data, ValidatorInterface $validator, array $options = array())
 {
     $this->validator = $validator;
     $this->setData($data);
     if (FormConfiguration::isDefaultCsrfProtectionEnabled()) {
         $this->enableCsrfProtection();
     }
     if (FormConfiguration::getDefaultLocale() !== null) {
         $this->setLocale(FormConfiguration::getDefaultLocale());
     }
     parent::__construct($name, $options);
 }
All Usage Examples Of Symfony\Component\Form\FormConfiguration::isDefaultCsrfProtectionEnabled