Example #1
0
 /**
  * Create a field object.
  * @param string $label - Label for the field.
  * @param array $options - Associated array of options.
  * @uses WTForms\Widgets\RadioWidget
  */
 public function __construct($label, $options = [])
 {
     parent::__construct($label);
     $this->setOptions($options);
     $this->widget = new RadioWidget();
     $this->type = 'radio';
 }
Example #2
0
 public function __construct($label, $validators = [], $options = [])
 {
     $this->widget = new TextWidget();
     $validator = new TypeValidator($this->_form, $this, 'float');
     $this->validators[get_class($validator)] = $validator;
     parent::__construct($label, $validators, $options);
 }
Example #3
0
 /**
  * Create a field object.
  * @param string $label - Label for the field.
  * @param array $options - Associated array of options.
  * @uses WTForms\Widgets\SelectWidget
  */
 public function __construct($label, $options = [])
 {
     $this->widget = new SelectWidget();
     $this->setOptions($options);
     $this->type = "select";
     parent::__construct($label);
 }
Example #4
0
 public function __construct($label, $validators = [], $options = [])
 {
     $validator = new TypeValidator($this->_form, $this, 'integer');
     $this->validators[get_class($validator)] = $validator;
     $this->type = 'number';
     parent::__construct($label, $validators, $options);
 }
Example #5
0
 /**
  * Create a field object.
  * @param string $label - Label for the field.
  * @uses WTForms\Widgets\BooleanWidget
  */
 public function __construct($label)
 {
     $this->widget = new BooleanWidget();
     parent::__construct($label);
     $this->type = 'checkbox';
 }
Example #6
0
 /**
  * Create a field object.
  * @param string $label - Label for the field.
  * @uses WTForms\Widgets\TextWidget
  */
 public function __construct($label, $validators = [], $options = [])
 {
     $validator = new TypeValidator($this->_form, $this, 'string');
     $this->validators[get_class($validator)] = $validator;
     parent::__construct($label, $validators, $options);
 }