/** * @inheritdoc */ public function init() { if (!$this->hasModel() && $this->name === null) { throw new InvalidConfigException("Either 'name', or 'model' and 'attribute' properties must be specified."); } $this->showCheckbox = true; $css = 'kv-tree-input-widget'; if (!$this->showToolbar) { $css .= ' kv-tree-nofooter'; } Html::addCssClass($this->treeOptions, $css); parent::init(); if ($this->hasModel()) { $this->value = Html::getAttributeValue($this->model, $this->attribute); } $this->_disabled = ArrayHelper::getValue($this->options, 'disabled', false); if ($this->asDropdown) { $this->initDropdown(); } }