diff --git a/frontend/views/bus-stop/index.php b/frontend/views/bus-stop/index.php index a94d8ce..67e0eb6 100644 --- a/frontend/views/bus-stop/index.php +++ b/frontend/views/bus-stop/index.php @@ -1,14 +1,15 @@ title = 'Bus Stops'; -$this->params['breadcrumbs'][] = $this->title; + $this->title = 'Bus Stops'; + $this->params[ 'breadcrumbs' ][] = $this->title; ?>
- = Html::a('Create Bus Stop', ['create'], ['class' => 'btn btn-success']) ?> + = Html::a('Create Bus Stop', [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
= GridView::widget([ 'dataProvider' => $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], + [ + 'attribute' => 'road_id', + 'value' => function($model) { + /** + * @var BusStop $model + */ + return $model->road->name; + }, + ], + [ + 'attribute' => 'region_id', + 'value' => function($model) { + /** + * @var BusStop $model + */ + return $model->region->name; + }, + ], + [ + 'attribute' => 'location_right', + 'value' => function($model) { + /** + * @var BusStop $model + */ + return $model->getRightString(); + }, + ], + [ + 'attribute' => 'location_left', + 'value' => function($model) { + /** + * @var BusStop $model + */ + return $model->getLeftString(); + }, + ], + [ + 'attribute' => 'state_common_id', + 'value' => function($model) { + /** + * @var BusStop $model + */ + return $model->stateCommon->value; + }, + ], - 'bus_stop_id', - 'road_id', - 'region_id', - 'settlement_id', - 'location_right', - // 'location_left', - // 'surface_type_id', - // 'area_stop_availability', - // 'area_land_availability', - // 'pocket_availability', - // 'toilet_availability', - // 'year_build', - // 'year_repair', - // 'state_common_id', - - ['class' => 'yii\grid\ActionColumn'], + [ 'class' => 'yii\grid\ActionColumn' ], ], ]); ?>