Blame view

views/shop/index.php 1.76 KB
a61ab7a7   Anastasia   stock
1
  <?php
77d77c34   Anastasia   stock
2
3
4
5
      
      use yii\helpers\Html;
      use yii\grid\GridView;
      use yiister\gentelella\widgets\Panel;
031b4e2b   Anastasia   filter
6
7
      use yii\helpers\Url;
     
77d77c34   Anastasia   stock
8
9
10
11
12
13
      
      /* @var $this yii\web\View */
      /* @var $dataProvider yii\data\ActiveDataProvider */
      
      $this->title = 'Shops';
      $this->params[ 'breadcrumbs' ][] = \Yii::t('stock', $this->title);
a61ab7a7   Anastasia   stock
14
15
16
  ?>
  <div class="shop-index">
      <?php
77d77c34   Anastasia   stock
17
          $xPanel = Panel::begin(
a61ab7a7   Anastasia   stock
18
              [
77d77c34   Anastasia   stock
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
                  'header' => \Yii::t('stock', Html::encode($this->title)),
              ]
          );
      ?>
    <h1><?= \Yii::t('stock', Html::encode($this->title)) ?></h1>
    
    <p>
        <?= Html::a(\Yii::t('stock', 'Create Shop'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
    </p>
      <?= GridView::widget(
          [
              'dataProvider' => $dataProvider,
              'columns'      => [
                  [ 'class' => 'yii\grid\SerialColumn' ],
                  
                  'id',
                  [
                      'attribute' => \Yii::t('stock', 'Address'),
                      'value'     => 'lang.address',
                  ],
                  'sort',
                  'status:boolean',
                  
031b4e2b   Anastasia   filter
42
43
44
45
46
47
48
49
50
51
52
53
                  [ 'class' => 'yii\grid\ActionColumn',
                    'template' => '{view} {update} {delete}{link}',
                  'buttons' => [
                  'link' => function ($url,$model,$key) {
                      return Html::a('Товары', Url::to([
                                                           '/variant-count/index',
                                                           'shop_id' => $model->id
                                                       ]));
                  },
                  'icon'  => 'gift',
                  ],
                  ],
a61ab7a7   Anastasia   stock
54
              ],
77d77c34   Anastasia   stock
55
56
          ]
      ); ?>
a61ab7a7   Anastasia   stock
57
      <?php
77d77c34   Anastasia   stock
58
          $xPanel::end();
a61ab7a7   Anastasia   stock
59
60
      ?>
  </div>