index.php 970 B

123456789101112131415161718192021222324252627282930313233343536
  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(Yii::t('common', '新页面'), ['create'], ['class' => 'btn btn-success']) ?>
  11. <?php $this->endBlock(); ?>
  12. <div class="box box-success">
  13. <div class="box-body">
  14. <?= GridView::widget([
  15. 'dataProvider' => $dataProvider,
  16. 'columns' => [
  17. 'id',
  18. // [
  19. // 'attribute' => 'use_layout',
  20. // 'value' => function ($model) {
  21. // $arr = ['不使用', '使用'];
  22. // return $arr[$model->use_layout];
  23. // },
  24. // ],
  25. 'title',
  26. 'slug',
  27. ['class' => 'common\helpers\DiyActionColumn'],
  28. ],
  29. ]); ?>
  30. </div>
  31. </div>