From 09abb556850d63f7fd417b8453a333ea325f5920 Mon Sep 17 00:00:00 2001 From: yarik Date: Wed, 13 Jul 2016 11:20:45 +0300 Subject: [PATCH] Yarik --- frontend/config/main.php | 2 +- frontend/views/road-to-category/index.php | 58 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 49 insertions(+), 11 deletions(-) diff --git a/frontend/config/main.php b/frontend/config/main.php index c7fd225..17edff9 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -29,7 +29,7 @@ return [ 'errorAction' => 'site/error', ], 'urlManager' => [ - 'enablePrettyUrl' => false, + 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ ], diff --git a/frontend/views/road-to-category/index.php b/frontend/views/road-to-category/index.php index 60fc793..375ae12 100644 --- a/frontend/views/road-to-category/index.php +++ b/frontend/views/road-to-category/index.php @@ -1,13 +1,14 @@ title = 'Road To Categories'; +$this->title = 'Категорії доріг'; $this->params['breadcrumbs'][] = $this->title; ?>
@@ -23,14 +24,51 @@ $this->params['breadcrumbs'][] = $this->title; 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], - - 'road_to_category_id', - 'region_id', - 'road_id', - 'begin', - 'end', - // 'distance', - // 'road_category_id', + [ + 'attribute' => 'region_id', + 'value' => function($model) { + /** + * @var RoadToCategory $model + */ + return $model->region->name; + } + ], + [ + 'attribute' => 'road_id', + 'value' => function($model) { + /** + * @var RoadToCategory $model + */ + return $model->road->name; + } + ], + [ + 'attribute' => 'begin', + 'value' => function($model) { + /** + * @var RoadToCategory $model + */ + return $model->getBeginString(); + } + ], + [ + 'attribute' => 'end', + 'value' => function($model) { + /** + * @var RoadToCategory $model + */ + return $model->getEndString(); + } + ], + [ + 'attribute' => 'road_category_id', + 'value' => function($model) { + /** + * @var RoadToCategory $model + */ + return $model->roadCategory->value; + } + ], ['class' => 'yii\grid\ActionColumn'], ], -- libgit2 0.21.4