Esempio n. 1
0
 /**
  * @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;
     $this->user_checked = false;
 }
Esempio n. 2
0
 /**
  * @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['maxlength'] = $max_length;
     $attributes['size'] = $size;
     parent::__construct($label, $validators, $attributes);
 }
Esempio n. 3
0
 /**
  * @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, $size, $precision, array $validators = array(), array $attributes = array())
 {
     $attributes['size'] = $size;
     parent::__construct($label, $validators, $attributes);
     $this->precision = $precision;
 }
Esempio n. 4
0
 /**
  * @param string $label the field's string label
  * @param array $mime_types a list of valid mime types
  * @param int $max_size the maximum upload size in bytes
  * @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 $mime_types, $max_size, array $validators = array(), array $attributes = array())
 {
     $this->types = $mime_types;
     $this->max_size = $max_size;
     parent::__construct($label, $validators, $attributes);
 }
Esempio n. 5
0
 /**
  * @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);
 }
Esempio n. 6
0
 /**
  * @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 = 'Phorm_Widget_SelectMultiple', array $validators = array(), array $attributes = array())
 {
     parent::__construct($label, $validators, $attributes);
     $this->choices = $choices;
     $this->widget = $widget;
 }
Esempio n. 7
0
 /**
  * @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())
 {
     parent::__construct($label, $validators, $attributes);
     $this->choices = $choices;
 }