/** * Initialises the widget */ public function init() { parent::init(); $enabledTab = null; foreach ($this->items as $i => $item) { $options = ArrayHelper::remove($item, 'options', []); if ($this->_activeTab === null && ArrayHelper::remove($options, 'active', false)) { $this->_activeTab = $i; } elseif ($enabledTab === null && ArrayHelper::getValue($options, 'enabled', true)) { $enabledTab = $i; } $this->items[$i]['options'] = $options; } if (empty($this->_activeTab)) { $this->_activeTab = $enabledTab; } }
/** * Initializes the widget. */ public function init() { parent::init(); Yii::$app->getView()->on(View::EVENT_END_BODY, [$this, 'renderModal']); }