fix crud
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use common\models\Project;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
@ -13,7 +14,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<div class="project-index">
|
||||
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<?php ?>
|
||||
<p>
|
||||
<?= Html::a('Создать', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
@ -24,11 +25,29 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id',
|
||||
'name',
|
||||
//'id',
|
||||
[
|
||||
'attribute' => 'name',
|
||||
'filter' => kartik\select2\Select2::widget([
|
||||
'model' => $searchModel,
|
||||
'attribute' => 'name',
|
||||
'data' => \common\models\Project::getListName(),
|
||||
'options' => ['placeholder' => 'Начните вводить...','class' => 'form-control'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]),
|
||||
],
|
||||
'budget',
|
||||
'description:ntext',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
[
|
||||
'label' => 'Исполнители',
|
||||
'value' => function($model){
|
||||
return implode(', ', $model->getUsersNameList());
|
||||
}
|
||||
],
|
||||
//'created_at',
|
||||
//'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
|
Reference in New Issue
Block a user