| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- use yii\grid\GridView;
- use common\helpers\Url;
- use common\helpers\Html;
- $this->title = '回收站(文章)';
- $this->params['breadcrumbs'][] = $this->title;
- ?>
- <div class="row">
- <div class="col-12">
- <div class="box">
- <div class="box-header">
- <h3 class="box-title"><?= $this->title; ?></h3>
- </div>
- <!-- /.box-header -->
- <div class="box-body table-responsive">
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'filterModel' => $searchModel,
- //重新定义分页样式
- 'tableOptions' => ['class' => 'table table-hover'],
- 'columns' => [
- [
- 'class' => 'yii\grid\SerialColumn',
- 'visible' => false, // 不显示#
- ],
- 'id',
- 'title',
- [
- 'attribute' => 'cate_id',
- 'value' => 'cate.title',
- 'filter' => Html::activeDropDownList($searchModel, 'cate_id', Yii::$app->tinyBlogService->cate->getMapList(), [
- 'prompt' => '全部',
- 'class' => 'form-control'
- ]
- )
- ],
- [
- 'label'=> '创建时间',
- 'attribute' => 'created_at',
- 'filter' => false, //不显示搜索框
- 'format' => ['date', 'php:Y-m-d H:i:s'],
- ],
- [
- 'header' => "操作",
- 'class' => 'yii\grid\ActionColumn',
- 'template'=> '{show} {delete}',
- 'buttons' => [
- 'show' => function ($url, $model, $key) {
- return Html::linkButton(['show', 'id' => $model->id], '还原');
- },
- 'delete' => function ($url, $model, $key) {
- return Html::delete(['destroy', 'id' => $model->id]);
- },
- ],
- ],
- ],
- ]); ?>
- <!-- /.box-body -->
- </div>
- <!-- /.box -->
- </div>
- </div>
- </div>
|