/** * ### . * init() * * Initializes the widget. */ public function init() { $this->htmlOptions['type'] = 'text'; $this->htmlOptions['autocomplete'] = 'off'; if (!isset($this->options['language'])) { $this->options['language'] = substr(Yii::app()->getLanguage(), 0, 2); } parent::init(); }
/** * Initializes the widget. */ public function init() { if (!isset($this->datasets['source'])) { $this->datasets['source'] = array(); } if (empty($this->options)) { $this->options['minLength'] = 1; } $this->registerClientScript(); if (!isset($this->htmlOptions['class']) || empty($this->htmlOptions['class'])) { $this->htmlOptions['class'] = 'typeahead'; } else { $this->htmlOptions['class'] .= ' typeahead'; } parent::init(); }
/** * Initializes the widget. */ public function init() { if (!isset($this->datasets['source'])) { $this->datasets['source'] = array(); } // @todo: which one is more correct? // if(!isset($this->datasets['source']) || empty($this->datasets['source'])) // throw new CException('you must provide datasets["source"] option'); if (empty($this->options)) { $this->options['minLength'] = 1; } $this->registerClientScript(); if (!isset($this->htmlOptions['class']) || empty($this->htmlOptions['class'])) { $this->htmlOptions['class'] = 'typeahead'; } else { $this->htmlOptions['class'] .= ' typeahead'; } parent::init(); }
/** *### .init() * * Initializes the widget. */ public function init() { $this->registerClientScript(); parent::init(); }