public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);

        if ($this->hasModel()) {
            echo $this->asDropDownList ?
                TbHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions) :
                TbHtml::activeHiddenField($this->model, $this->attribute);

        } else {
            echo $this->asDropDownList ?
                TbHtml::dropDownList($this->name, $this->value, $this->data, $this->htmlOptions) :
                TbHtml::hiddenField($this->name, $this->value);
        }
    }
public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);

        if ($this->hasModel()) {
            echo $this->asDropDownList ?
                TbHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions) :
                TbHtml::activeHiddenField($this->model, $this->attribute);

        } else {
            echo $this->asDropDownList ?
                TbHtml::dropDownList($this->name, $this->value, $this->data, $this->htmlOptions) :
                TbHtml::hiddenField($this->name, $this->value);
        }
    }
public function renderField ( ) { list ( $ name , $ id ) = $ this -> resolveNameID ( ) ; TbArray :: defaultValue ( 'id' , $ id , $ this -> htmlOptions ) ; TbArray :: defaultValue ( 'name' , $ name , $ this -> htmlOptions ) ; if ( $ this -> hasModel ( ) ) { echo $ this -> asDropDownList ? TbHtml :: activeDropDownList ( $ this -> model , $ this -> attribute , $ this -> data , $ this -> htmlOptions ) : TbHtml :: activeHiddenField ( $ this -> model , $ this -> attribute ) ; } else { echo $ this -> asDropDownList ? TbHtml :: dropDownList ( $ this -> name , $ this -> value , $ this -> data , $ this -> htmlOptions ) : TbHtml :: hiddenField ( $ this -> name , $ this -> value ) ; } }
Renders the select2 field
Renders the select2 field