Blame view

common/modules/product/views/variant/update.php 1.86 KB
d8c1a2e0   Yarik   Big commit artbox
1
  <?php
d55d2fe0   Yarik   Multilanguage
2
      
4e55ce81   Yarik   Another one admin...
3
      use common\modules\product\models\Product;
d55d2fe0   Yarik   Multilanguage
4
5
6
7
8
9
10
11
12
13
14
15
16
17
      use common\modules\product\models\ProductStock;
      use common\modules\product\models\ProductVariant;
      use common\modules\product\models\ProductVariantLang;
      use yii\db\ActiveQuery;
      use yii\helpers\Html;
      use yii\helpers\Url;
      use yii\web\View;
      
      /**
       * @var View                 $this
       * @var ProductVariant       $model
       * @var ProductVariantLang[] $model_langs
       * @var ActiveQuery          $groups
       * @var ProductStock[]       $stocks
4e55ce81   Yarik   Another one admin...
18
       * @var Product              $product
d55d2fe0   Yarik   Multilanguage
19
20
21
       */
      $this->title = Yii::t('product', 'Update {modelClass}: ', [
              'modelClass' => 'Product',
4e55ce81   Yarik   Another one admin...
22
          ]) . ' ' . $model->lang->name;
d55d2fe0   Yarik   Multilanguage
23
24
      $this->params[ 'breadcrumbs' ][] = [
          'label' => Yii::t('product', 'Products'),
4e55ce81   Yarik   Another one admin...
25
          'url'   => [ '/product/manage/index' ],
d55d2fe0   Yarik   Multilanguage
26
27
      ];
      $this->params[ 'breadcrumbs' ][] = [
4e55ce81   Yarik   Another one admin...
28
          'label' => $model->product->lang->name,
d55d2fe0   Yarik   Multilanguage
29
          'url'   => [
4e55ce81   Yarik   Another one admin...
30
              '/product/manage/view',
d55d2fe0   Yarik   Multilanguage
31
32
33
34
35
36
              'id' => $model->product->product_id,
          ],
      ];
      $this->params[ 'breadcrumbs' ][] = [
          'label' => Yii::t('product', 'Variants'),
          'url'   => Url::to([
4e55ce81   Yarik   Another one admin...
37
              'index',
d55d2fe0   Yarik   Multilanguage
38
39
40
              'product_id' => $model->product->product_id,
          ]),
      ];
4e55ce81   Yarik   Another one admin...
41
42
43
44
45
46
47
      $this->params[ 'breadcrumbs' ][] = [
          'label' => Yii::t('product', $model->lang->name),
          'url'   => Url::to([
              'view',
              'id' => $model->product_variant_id,
          ]),
      ];
d55d2fe0   Yarik   Multilanguage
48
      $this->params[ 'breadcrumbs' ][] = Yii::t('product', 'Update');
d8c1a2e0   Yarik   Big commit artbox
49
50
  ?>
  <div class="product-update">
d55d2fe0   Yarik   Multilanguage
51
      
d8c1a2e0   Yarik   Big commit artbox
52
      <h1><?= Html::encode($this->title) ?></h1>
d55d2fe0   Yarik   Multilanguage
53
      
d8c1a2e0   Yarik   Big commit artbox
54
      <?= $this->render('_form', [
d55d2fe0   Yarik   Multilanguage
55
56
57
58
          'model'       => $model,
          'model_langs' => $model_langs,
          'groups'      => $groups,
          'stocks'      => $stocks,
4e55ce81   Yarik   Another one admin...
59
          'product'     => $product,
d8c1a2e0   Yarik   Big commit artbox
60
61
62
      ]) ?>
  
  </div>