= $this->title ?>
= Html::a(''.' '. Yii::t('backend', 'Create'), ['create'],
['class' => 'btn btn-info d-none d-lg-block m-l-15 pull-right']) ?>
$dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => \yii\grid\SerialColumn::className()],
[
'attribute' => 'first_name',
'filterInputOptions' => ['class' => 'form-control col-md-6'],
'value' => function (AdminUser $model) {
return $model->first_name;
}
],
[
'attribute' => 'role_name',
'filterInputOptions' => ['class' => 'form-control col-md-6'],
'value' => function (AdminUser $model) {
return $model->role_name;
}
],
'last_login',
[
'attribute' => yii::t('backend','status'),
'filter' => [AdminUser::ACTIVE => 'active', AdminUser::INACTIVE => 'Inactive'],
'filterInputOptions' => ['class' => 'select2 form-control col-md-4', 'prompt' => 'All'],
'format' => 'raw',
'value' => function (AdminUser $model) {
$id = Html::getInputId($model, 'status') . "-{$model->getPrimaryKey()}";
$html = Html::activeCheckbox($model, 'status',
['data-size'=> 'mini','data-toggle' => 'switch', 'label' => false, 'id' => $id]);
$html .= Html::tag('span', Html::label('', $id));
return Html::tag('div', $html, ['class' => 'bootstrap-switch']);
}
],
[
'class' => \yii\grid\ActionColumn::className(),
'header' => Yii::t('backend', 'Actions'),
'template' => '{update}',
'buttons' => [
'update' => function ($url, $model, $key) {
$html = Html::tag('span', '', ['class' => 'fa fa-pencil text-inverse m-r-10']);
return Html::a($html, $url);
},
],
],
],
]); ?>