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->key = (string) $key; $this->locale = class_exists('\\Locale', false) ? \Locale::getDefault() : 'en'; $this->generator = new HtmlGenerator(); parent::__construct($options); $this->transformedData = $this->transform($this->data); $this->required = $this->getOption('required'); $this->setPropertyPath($this->getOption('property_path')); }
/** * Constructor. * * @param array $options An array of options * * @throws \InvalidArgumentException when a option is not supported * @throws \RuntimeException when a required option is not given */ public function __construct(array $options = array()) { $this->locale = class_exists('\\Locale', false) ? \Locale::getDefault() : 'en'; parent::__construct($options); }