예제 #1
0
파일: Field.php 프로젝트: pgodel/PageRoller
 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'));
 }
예제 #2
0
 /**
  * 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);
 }