recycle.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. use yii\grid\GridView;
  3. use common\helpers\Url;
  4. use common\helpers\Html;
  5. $this->title = '回收站(文章)';
  6. $this->params['breadcrumbs'][] = $this->title;
  7. ?>
  8. <div class="row">
  9. <div class="col-12">
  10. <div class="box">
  11. <div class="box-header">
  12. <h3 class="box-title"><?= $this->title; ?></h3>
  13. </div>
  14. <!-- /.box-header -->
  15. <div class="box-body table-responsive">
  16. <?= GridView::widget([
  17. 'dataProvider' => $dataProvider,
  18. 'filterModel' => $searchModel,
  19. //重新定义分页样式
  20. 'tableOptions' => ['class' => 'table table-hover'],
  21. 'columns' => [
  22. [
  23. 'class' => 'yii\grid\SerialColumn',
  24. 'visible' => false, // 不显示#
  25. ],
  26. 'id',
  27. 'title',
  28. [
  29. 'attribute' => 'cate_id',
  30. 'value' => 'cate.title',
  31. 'filter' => Html::activeDropDownList($searchModel, 'cate_id', Yii::$app->tinyBlogService->cate->getMapList(), [
  32. 'prompt' => '全部',
  33. 'class' => 'form-control'
  34. ]
  35. )
  36. ],
  37. [
  38. 'label'=> '创建时间',
  39. 'attribute' => 'created_at',
  40. 'filter' => false, //不显示搜索框
  41. 'format' => ['date', 'php:Y-m-d H:i:s'],
  42. ],
  43. [
  44. 'header' => "操作",
  45. 'class' => 'yii\grid\ActionColumn',
  46. 'template'=> '{show} {delete}',
  47. 'buttons' => [
  48. 'show' => function ($url, $model, $key) {
  49. return Html::linkButton(['show', 'id' => $model->id], '还原');
  50. },
  51. 'delete' => function ($url, $model, $key) {
  52. return Html::delete(['destroy', 'id' => $model->id]);
  53. },
  54. ],
  55. ],
  56. ],
  57. ]); ?>
  58. <!-- /.box-body -->
  59. </div>
  60. <!-- /.box -->
  61. </div>
  62. </div>
  63. </div>
粤ICP备19079148号