Blame view

artweb/artbox-catalog/views/variant-option-excl/_form.php 1.49 KB
16f1e516   mzavalniuk   add artbox-catalo...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
  <?php
      
      use artbox\catalog\models\Option;
      use artbox\catalog\models\OptionLang;
      use artbox\core\components\imagemanager\components\ImageManagerInputWidget;
      use artbox\core\widgets\LanguageForm;
      use yii\helpers\Html;
      use yii\web\View;
      use yii\widgets\ActiveForm;
      
      /**
       * @var OptionLang[] $modelLangs
       * @var Option       $model
       * @var ActiveForm   $form
       * @var View         $this
       */
  ?>
  
  <div class="option-form">
      
      <?php $form = ActiveForm::begin(); ?>
      
      <?= $form->field($model, 'image_id')
               ->widget(
                   ImageManagerInputWidget::className(),
                   [
                       'showPreview' => true,
                   ]
               ) ?>
      
      <?= LanguageForm::widget(
          [
              'modelLangs' => $modelLangs,
              'formView'   => '@artbox/catalog/views/variant-option-excl/_form_language',
              'form'       => $form,
          ]
      ) ?>
      
      <?= $form->field($model, 'sort')
               ->textInput() ?>
      
      <?= $form->field($model, 'status')
               ->checkbox(
                   [
                       'class' => 'flat',
                   ]
               ) ?>
      
      <div class="form-group">
          <?= Html::submitButton(
              $model->isNewRecord ? Yii::t('catalog', 'Create') : Yii::t('catalog', 'Update'),
              [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]
          ) ?>
      </div>
      
      <?php ActiveForm::end(); ?>
  
  </div>