Exemplo n.º 1
0
 public function __construct($attrs = null)
 {
     $default_attrs = array('cols' => '40', 'rows' => '10');
     if (!is_null($attrs)) {
         $default_attrs = array_merge($default_attrs, $attrs);
     }
     parent::__construct($default_attrs);
 }
Exemplo n.º 2
0
 /**
  * Creates a select widget.
  *
  * @param array $attrs   The attributes to use when rendering the widget.
  * @param array $choices The choices to use for select options.
  *
  * @return null
  */
 public function __construct($attrs = null, $choices = null)
 {
     /**
      * Run default widget constructor.
      */
     parent::__construct($attrs);
     /**
      * Initialize choices array if not given.
      */
     if (is_null($choices)) {
         $choices = array();
     }
     /**
      * Store widget choices.
      */
     $this->choices = $choices;
 }
Exemplo n.º 3
0
 /**
  * Returns the value of this widget determined by the data and name.
  *
  * @return mixed
  */
 public function valueFromData($data, $files, $name)
 {
     if (!array_key_exists($name, $data)) {
         return false;
     }
     return parent::valueFromData($data, $files, $name);
 }