TreeView.php
public function run() {
        if ($this->size !== self::SIZE_NORMAL) {
            $this->options['class'] = $this->size;
        }

        $parts = [
            '{tree}' =>  Html::tag('div', '', $this->options)
        ];
        $template = $this->template;
        if (strpos($this->template, '{tree}') === false) {
            throw new Exception('{tree} not found in widget template');
        }

        $parts = [
            '{tree}' => Html::tag('div', '', $this->options),
            '{header}' => $this->header,
        ];

        if (strpos($this->template, '{search}') !== false) {
            $parts['{search}'] = $this->renderSearchWidget();
        }

        echo Html::tag('div', strtr($this->template, $parts), $this->containerOptions);

        $this->_initDefaultIcon($this->data);
        $this->clientOptions['data'] = $this->data;

        $this->registerWidget('treeview');
    }
public function run() {
        if ($this->size !== self::SIZE_NORMAL) {
            $this->options['class'] = $this->size;
        }

        $parts = [
            '{tree}' =>  Html::tag('div', '', $this->options)
        ];
        $template = $this->template;
        if (strpos($this->template, '{tree}') === false) {
            throw new Exception('{tree} not found in widget template');
        }

        $parts = [
            '{tree}' => Html::tag('div', '', $this->options),
            '{header}' => $this->header,
        ];

        if (strpos($this->template, '{search}') !== false) {
            $parts['{search}'] = $this->renderSearchWidget();
        }

        echo Html::tag('div', strtr($this->template, $parts), $this->containerOptions);

        $this->_initDefaultIcon($this->data);
        $this->clientOptions['data'] = $this->data;

        $this->registerWidget('treeview');
    }
Run widget