| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- /**
- * Author: lf
- * Blog: https://blog.feehi.com
- * Email: job@feehi.com
- * Created at: 2016-03-23 17:51
- */
- /**
- * @var $this yii\web\View
- * @var $dataProvider yii\data\ActiveDataProvider
- * @var $searchModel backend\models\search\AdminUserSearch
- */
- use backend\grid\DateColumn;
- use backend\grid\GridView;
- use common\models\User;
- use backend\widgets\Bar;
- use backend\grid\CheckboxColumn;
- use backend\grid\ActionColumn;
- $this->title = 'Users';
- $this->params['breadcrumbs'][] = Yii::t('app', 'Users');
- ?>
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox">
- <?= $this->render('/widgets/_ibox-title') ?>
- <div class="ibox-content">
- <?= Bar::widget([
- 'template' => '{refresh} {create} {delete}',
- ]) ?>
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'filterModel' => $searchModel,
- 'columns' => [
- [
- 'class' => CheckboxColumn::className(),
- ],
- [
- 'attribute' => 'id',
- ],
- [
- 'attribute' => 'username',
- ],
- [
- 'attribute' => 'email',
- ],
- [
- 'attribute' => 'status',
- 'label' => Yii::t('app', 'Status'),
- 'value' => function ($model) {
- if($model->status == User::STATUS_ACTIVE){
- return Yii::t('app', 'Normal');
- }else if( $model->status == User::STATUS_DELETED ){
- return Yii::t('app', 'Disabled');
- }
- },
- 'filter' => User::getStatuses(),
- ],
- [
- 'class' => DateColumn::className(),
- 'attribute' => 'created_at',
- ],
- [
- 'class' => DateColumn::className(),
- 'attribute' => 'updated_at',
- ],
- [
- 'class' => ActionColumn::className(),
- 'width' => '190px',
- ],
- ]
- ]); ?>
- </div>
- </div>
- </div>
- </div>
|