index.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. use common\helpers\Html;
  3. use common\helpers\Url;
  4. use yii\grid\GridView;
  5. /* @var $this yii\web\View */
  6. /* @var $dataProvider yii\data\ActiveDataProvider */
  7. $this->title = 'Activities';
  8. $this->params['breadcrumbs'][] = $this->title;
  9. ?>
  10. <div class="row">
  11. <div class="col-12">
  12. <div class="box">
  13. <div class="box-header">
  14. <h3 class="box-title"><?= Html::encode($this->title) ?></h3>
  15. <div class="box-tools">
  16. <?= Html::create(['edit']) ?>
  17. </div>
  18. </div>
  19. <div class="box-body table-responsive">
  20. <?= GridView::widget([
  21. 'dataProvider' => $dataProvider,
  22. 'tableOptions' => ['class' => 'table table-hover'],
  23. 'columns' => [
  24. [
  25. 'class' => 'yii\grid\SerialColumn',
  26. 'visible' => false,
  27. ],
  28. 'id',
  29. 'title',
  30. //'cover',
  31. //'seo_content',
  32. 'description',
  33. //'seo_key',
  34. //'content',
  35. 'view',
  36. //'sort',
  37. 'check_max',
  38. 'check',
  39. 'author',
  40. //'status',
  41. //'created_at',
  42. //'updated_at',
  43. [
  44. 'class' => 'yii\grid\ActionColumn',
  45. 'header' => '操作',
  46. 'template' => '{edit} {status} {delete}',
  47. 'buttons' => [
  48. 'edit' => function($url, $model, $key){
  49. return Html::edit(['edit', 'id' => $model->id]);
  50. },
  51. 'status' => function($url, $model, $key){
  52. return Html::status($model['status']);
  53. },
  54. 'delete' => function($url, $model, $key){
  55. return Html::delete(['delete', 'id' => $model->id]);
  56. },
  57. ]
  58. ]
  59. ]
  60. ]); ?>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
粤ICP备19079148号