/** * @inheritdoc */ public function init() { $config = $this->_initConfig(); //Setup dataprovider $this->dataProvider = (new LanguageSearch())->search($config); if (empty($this->rowOptions)) { $this->rowOptions = function ($model, $key, $index, $grid) { return ['class' => $model['status'] == -1 ? 'danger' : ($model['status'] == 1 ? 'info' : 'active')]; }; } //Parse widget template configuration string in to an array $this->_template = TemplateHelper::explode($this->template); //Run parent Gridview initialisation invokes overwritten initColumns method parent::init(); }
/** * Initializes the default button rendering callbacks. */ protected function initDefaultButtons() { foreach (TemplateHelper::explode($this->template) as $button) { $this->initDefaultButton($button); } }