Blame view

frontend/views/road-width/index.php 1.98 KB
984ae8aa   Eugeny Galkovskiy   120716
1
2
  <?php
  
9c91f7e0   Yarik   Yarik
3
4
5
      use common\models\RoadWidth;
      use yii\helpers\Html;
      use yii\grid\GridView;
984ae8aa   Eugeny Galkovskiy   120716
6
  
9c91f7e0   Yarik   Yarik
7
8
9
      /* @var $this yii\web\View */
      /* @var $searchModel common\models\RoadWidthSearch */
      /* @var $dataProvider yii\data\ActiveDataProvider */
984ae8aa   Eugeny Galkovskiy   120716
10
  
9c91f7e0   Yarik   Yarik
11
12
      $this->title = 'Ширина проїзної частини';
      $this->params[ 'breadcrumbs' ][] = $this->title;
984ae8aa   Eugeny Galkovskiy   120716
13
14
15
16
17
18
19
  ?>
  <div class="road-width-index">
  
      <h1><?= Html::encode($this->title) ?></h1>
      <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  
      <p>
9c91f7e0   Yarik   Yarik
20
          <?= Html::a('Create Road Width', [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
984ae8aa   Eugeny Galkovskiy   120716
21
22
23
      </p>
      <?= GridView::widget([
          'dataProvider' => $dataProvider,
9c91f7e0   Yarik   Yarik
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
          'filterModel'  => $searchModel,
          'columns'      => [
              [ 'class' => 'yii\grid\SerialColumn' ],
              [
                  'attribute' => 'region_id',
                  'value'     => function($model) {
                      /**
                       * @var RoadWidth $model
                       */
                      return $model->region->name;
                  },
              ],
              [
                  'attribute' => 'road_id',
                  'value'     => function($model) {
                      /**
                       * @var RoadWidth $model
                       */
                      return $model->road->name;
                  },
              ],
              [
                  'attribute' => 'begin',
                  'value'     => function($model) {
                      /**
                       * @var RoadWidth $model
                       */
                      return $model->getBeginString();
                  },
              ],
              [
                  'attribute' => 'end',
                  'value'     => function($model) {
                      /**
                       * @var RoadWidth $model
                       */
                      return $model->getEndString();
                  },
              ],
984ae8aa   Eugeny Galkovskiy   120716
63
  
9c91f7e0   Yarik   Yarik
64
              [ 'class' => 'yii\grid\ActionColumn' ],
984ae8aa   Eugeny Galkovskiy   120716
65
66
67
          ],
      ]); ?>
  </div>