Ejemplo n.º 1
0
 /**
  * Instantiates a select field.
  *
  * @param mixed   $label               The label to display for the field. 
  *                                     Pass null for the class default.
  * @param mixed   $help_text           The help text to display for the  
  *                                     field. Pass null for the class
  *                                     default.
  * @param mixed   $initial             The initial value to use for the 
  *                                     field. Pass null for the class 
  *                                     default.
  * @param boolean $required            A flag indicating whether a field is 
  *                                     required.
  * @param mixed   $widget              The class name or instance of the 
  *                                     widget for the field.
  * @param array   $error_messages      An array of error messages for the 
  *                                     field.
  * @param boolean $show_hidden_initial A flag indicating whether a field
  *                                     should be rendered with a hidden
  *                                     widget containing the initial value.
  *
  * @return null
  */
 public function __construct($label = null, $help_text = null, $choices = null, $initial = null, $required = true, $widget = null, $error_messages = null, $show_hidden_initial = false)
 {
     parent::__construct($label, $help_text, $initial, $required, $widget, $error_messages, $show_hidden_initial);
     if (is_null($choices)) {
         $choices = array();
     }
     $this->choices = $choices;
 }
Ejemplo n.º 2
0
 public function __construct($label = null, $help_text = null, $max_length = null, $min_length = null, $initial = null, $required = true, $widget = null, $error_messages = null, $show_hidden_initial = false)
 {
     $this->max_length = $max_length;
     $this->min_length = $min_length;
     parent::__construct($label, $help_text, $initial, $required, $widget, $error_messages, $show_hidden_initial);
 }