예제 #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);
 }
예제 #2
0
파일: Select.php 프로젝트: xdissent/dforms
 /**
  * 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;
 }
예제 #3
0
 /**
  * The constructor.
  *
  * @param array $attrs      The attributes to use when rendering the widget.
  * @param mixed $check_test The function to determine whether the widget is
  *                          checked.
  *
  * @return null
  */
 public function __construct($attrs = null, $check_test = null)
 {
     parent::__construct($attrs);
     $this->check_test = $check_test;
 }