index.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use yii\grid\GridView;
  3. use yii\helpers\Html;
  4. use yii\widgets\Pjax;
  5. /*
  6. * @var yii\web\View $this
  7. * @var yii\data\ActiveDataProvider $dataProvider
  8. * @var rbac\models\AuthItemSearch $searchModel
  9. */
  10. $this->title = Yii::t('rbac', 'Roles');
  11. $this->params['breadcrumbs'][] = $this->title;
  12. ?>
  13. <?php $this->beginBlock('content-header') ?>
  14. <?= $this->title . ' ' . Html::a(Yii::t('app', '新角色'), ['create'], ['class' => 'btn btn-primary btn-flat btn-xs']) ?>
  15. <?php $this->endBlock() ?>
  16. <div class="box box-primary">
  17. <div class="box-body">
  18. <?php
  19. Pjax::begin([
  20. 'enablePushState' => false,
  21. ]);
  22. echo GridView::widget([
  23. 'dataProvider' => $dataProvider,
  24. 'filterModel' => $searchModel,
  25. 'columns' => [
  26. ['class' => 'yii\grid\SerialColumn'],
  27. [
  28. 'attribute' => 'name',
  29. 'label' => Yii::t('rbac', 'Name'),
  30. ],
  31. [
  32. 'attribute' => 'description',
  33. 'label' => Yii::t('rbac', 'Description'),
  34. ],
  35. ['class' => 'yii\grid\ActionColumn'],
  36. ],
  37. ]);
  38. Pjax::end();
  39. ?>
  40. </div>
  41. </div>