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); }
/** * 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; }
/** * 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; }