/** * 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'; }
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); }
/** * 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); }
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); }
/** * 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'; }
/** * 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); }