Beispiel #1
0
 /**
  * @author Jeff Ober
  * @param string $label the field's text label
  * @param int $size the field's size attribute
  * @param int $max_length the maximum size in characters
  * @param array $validators a list of callbacks to validate the field data
  * @param array $attributes a list of key/value pairs representing HTML attributes
  **/
 public function __construct($label, $size, $max_length, array $validators = array(), array $attributes = array())
 {
     $this->max_length = $max_length;
     $attributes['size'] = $size;
     parent::__construct($label, $validators, $attributes);
 }
Beispiel #2
0
 /**
  * @author Jeff Ober
  * @param string $label the field's text label
  * @param array $choices a list of choices as actual_value=>display_value
  * @param array $widget is one of MultiSelectWidget (default), RadioWidget, or CheckboxWidget
  * @param array $validators a list of callbacks to validate the field data
  * @param array $attributes a list of key/value pairs representing HTML attributes
  **/
 public function __construct($label, array $choices, $widget = 'MultiSelectWidget', array $validators = array(), array $attributes = array())
 {
     parent::__construct($label, $validators, $attributes);
     $this->choices = $choices;
     $this->widget = $widget;
 }
Beispiel #3
0
 /**
  * @author Jeff Ober
  * @param string $label the field's text label
  * @param int $max_digits the maximum number of digits permitted
  * @param array $validators a list of callbacks to validate the field data
  * @param array $attributes a list of key/value pairs representing HTML attributes
  **/
 public function __construct($label, $max_digits, array $validators = array(), array $attributes = array())
 {
     $attributes['size'] = 20;
     parent::__construct($label, $validators, $attributes);
     $this->max_digits = $max_digits;
 }
Beispiel #4
0
 /**
  * @author Jeff Ober
  * @param string $label the field's text label
  * @param array $validators a list of callbacks to validate the field data
  * @param array $attributes a list of key/value pairs representing HTML attributes
  **/
 public function __construct($label, array $validators = array(), array $attributes = array())
 {
     parent::__construct($label, $validators, $attributes);
     parent::set_value('on');
     $this->checked = false;
 }
Beispiel #5
0
 /**
  * @author Jeff Ober
  * @param string $label the field's text label
  * @param int $precision the maximum number of decimals permitted
  * @param array $validators a list of callbacks to validate the field data
  * @param array $attributes a list of key/value pairs representing HTML attributes
  **/
 public function __construct($label, $precision, array $validators = array(), array $attributes = array())
 {
     $attributes['size'] = 20;
     parent::__construct($label, $validators, $attributes);
     $this->precision = $precision;
 }
Beispiel #6
0
 /**
  * @author Jeff Ober
  * @param string $label the field's text label
  * @param array $choices a list of choices as actual_value=>display_value
  * @param array $validators a list of callbacks to validate the field data
  * @param array $attributes a list of key/value pairs representing HTML attributes
  **/
 public function __construct($label, array $choices, array $validators = array(), array $attributes = array(), $options = array())
 {
     parent::__construct($label, $validators, $attributes);
     $this->choices = $choices;
     $this->options = array_merge($this->options, $options);
 }
Beispiel #7
0
 /**
  * @author Jeff Ober
  * @param string $label the field's text label
  * @param int $rows the number of rows
  * @param int $cols the number of columns
  * @param array $validators a list of callbacks to validate the field data
  * @param array $attributes a list of key/value pairs representing HTML attributes
  **/
 public function __construct($label, $rows, $cols, array $validators = array(), array $attributes = array())
 {
     $attributes['cols'] = $cols;
     $attributes['rows'] = $rows;
     parent::__construct($label, $validators, $attributes);
 }