guild/backend/modules/project/views/project-column/index.php

48 lines
1.4 KiB
PHP
Raw Normal View History

2023-04-20 02:07:19 +03:00
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\project\models\ProjectColumnSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Колонки проектов';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="project-column-index">
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Создать', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
// 'id',
'title',
[
'attribute' => 'project_id',
'value' => function(\common\models\ProjectColumn $model){
return $model->project->name ?? 'Не задано';
}
],
'created_at',
'updated_at',
[
'attribute' => 'status',
'value' => function (\common\models\ProjectColumn $model) {
return \common\models\ProjectColumn::getStatus()[$model->status] ?? 'Не задано';
}
],
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>