yii2-netdisk/views/collection/index.php

48 lines
1.2 KiB
PHP
Raw Normal View History

<?php
use app\models\CollectionTasks;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\ActionColumn;
use yii\grid\GridView;
/** @var yii\web\View $this */
/** @var app\models\CollectionSearch $searchModel */
/** @var yii\data\ActiveDataProvider $dataProvider */
$this->title = '文件收集';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="collection-tasks-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('创建文件收集', ['home/index'], ['class' => 'btn btn-success']) ?>
</p>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
// 'user_id',
'folder_path',
'created_at',
'secret',
[
'class' => ActionColumn::className(),
'urlCreator' => function ($action, CollectionTasks $model, $key, $index, $column) {
return Url::toRoute([$action, 'id' => $model->id]);
}
],
],
]); ?>
</div>