示例#1
0
 /**
  * Renders the filter content
  * @return string
  */
 public function render()
 {
     $defaults = ['class' => 'form-control'];
     if ($this->multiple) {
         $defaults['multiple'] = 'multiple';
     } else {
         $defaults['prompt'] = \Yii::t('admin/gridview', 'All');
     }
     $options = array_merge($defaults, $this->options);
     return Select2::widget(['bootstrap' => true, 'model' => $this->getModel(), 'attribute' => $this->getAttribute(), 'items' => $this->values, 'options' => $options]) . $this->getError();
 }
示例#2
0
 /**
  * Renders the filter content
  * @return string
  */
 public function render()
 {
     $options = array_merge(['prompt' => '', 'class' => 'form-control'], $this->options);
     return Select2::widget(['bootstrap' => true, 'model' => $this->column->grid->filterModel, 'attribute' => $this->column->attribute, 'items' => ArrayHelper::merge(['' => ''], $this->values), 'options' => $options]) . $this->getError();
 }