index.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. use yii\grid\GridView;
  3. use yii\helpers\Html;
  4. /* @var $this yii\web\View */
  5. /* @var $dataProvider yii\data\ActiveDataProvider */
  6. $this->title = '用户';
  7. $this->params['breadcrumbs'][] = $this->title;
  8. ?>
  9. <?php $this->beginBlock('content-header') ?>
  10. <?= $this->title . ' ' . Html::a('新用户', ['create'], ['class' => 'btn btn-primary btn-flat btn-xs']) ?>
  11. <?php $this->endBlock() ?>
  12. <!--搜索-->
  13. <?php echo $this->render('_search', ['model' => $searchModel]); ?>
  14. <div class="box box-primary">
  15. <div class="box-body">
  16. <?= GridView::widget([
  17. 'dataProvider' => $dataProvider,
  18. // 'filterModel' => $searchModel,
  19. 'columns' => [
  20. 'id',
  21. 'pid',
  22. 'nickname',
  23. [
  24. 'attribute' => 'avatar',
  25. "format" => [
  26. "image", [
  27. "width" => "60",
  28. "height" => "60",
  29. "class" => 'img-circle'
  30. ]
  31. ]
  32. ],
  33. 'allRoleDesc:text:角色',
  34. 'tel',
  35. 'email',
  36. 'created_at:datetime',
  37. 'login_at:datetime',
  38. [
  39. 'class' => 'yii\grid\ActionColumn',
  40. 'template' => '{update} {delete}'
  41. ]
  42. ],
  43. ]); ?>
  44. </div>
  45. </div>