skeeks\cms\widgets\formInputs\selectTree\SelectTreeInputWidget::run PHP 메소드

run() 공개 메소드

public run ( )
    public function run()
    {
        $value = $this->model->{$this->attribute};
        $items = $value;
        if ($value && is_string($value) || is_int($value)) {
            $items = [$value => $value];
        }
        if (!$items) {
            $items = [];
        }
        $this->options['multiple'] = $this->multiple;
        Html::addCssClass($this->options, 'sx-widget-element');
        $select = Html::activeListBox($this->model, $this->attribute, $items, $this->options);
        $this->clientOptions['value'] = $value;
        $this->clientOptions['multiple'] = (int) $this->multiple;
        $this->registerAssets();
        return $this->render('select-tree-widget', ['elementForm' => $select]);
    }