getDefaultLocale() public static method

Returns the default locale for newly created forms.
public static getDefaultLocale ( ) : string
return string
Esempio n. 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);
 }
Esempio n. 2
0
 public function __construct($key, array $options = array())
 {
     $this->addOption('trim', true);
     $this->addOption('required', true);
     $this->addOption('disabled', false);
     $this->addOption('property_path', (string) $key);
     $this->addOption('value_transformer');
     $this->addOption('normalization_transformer');
     $this->key = (string) $key;
     $this->locale = FormConfiguration::getDefaultLocale();
     parent::__construct($options);
     if ($this->getOption('value_transformer')) {
         $this->setValueTransformer($this->getOption('value_transformer'));
     }
     if ($this->getOption('normalization_transformer')) {
         $this->setNormalizationTransformer($this->getOption('normalization_transformer'));
     }
     $this->normalizedData = $this->normalize($this->data);
     $this->transformedData = $this->transform($this->normalizedData);
     $this->required = $this->getOption('required');
     $this->setPropertyPath($this->getOption('property_path'));
 }