Blame view

backend/views/product/_form.php 2 KB
0a6fda24   Volodymyr   product admin vie...
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
  <?php
      
      use yii\helpers\Html;
      use yii\widgets\ActiveForm;
      use artbox\core\components\imagemanager\components\ImageManagerInputWidget;
      use artbox\core\widgets\LanguageForm;
      
      /**
       * @var \yii\web\View                 $this
       * @var \common\models\Objectkb       $model
       * @var \common\models\ObjectkbLang[] $modelLangs
       * @var \common\models\Slider[]       $sliders
       */
  ?>
  
  <div class="objectkb-form">
      
      <?php
          $form = ActiveForm::begin();
      ?>
  
      <?= LanguageForm::widget(
          [
              'modelLangs' => $modelLangs,
              'formView'   => '@backend/views/product/_form_language',
              'form'       => $form,
          ]
      ) ?>
      <?= $form->field($model, 'sku')
          ->textInput() ?>
96c82e64   Volodymyr   product admin price
31
32
      <?= $form->field($model, 'price')
          ->textInput() ?>
0a6fda24   Volodymyr   product admin vie...
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
      <?= $form->field($model, 'sort')
               ->textInput() ?>
  
  
      <?= $form->field($model, 'image_id')
                    ->widget(
                        ImageManagerInputWidget::className(),
                        [
                            'aspectRatio'                  => ( 16 / 9 ),
                            //set the aspect ratio
                            'showPreview'                  => true,
                            //false to hide the preview
                            'showDeletePickedImageConfirm' => false,
                            //on true show warning before detach image
                        ]
                    )
      ?>
      
      <?= $form->field($model, 'status')
               ->checkbox() ?>
71161f15   Volodymyr   add type to product
53
54
55
56
57
58
  
      <?= $form->field($model, 'type')
          ->dropDownList(
              ['Отображать во всех', 'Для компаний', 'Для частных лиц']
  
          ) ?>
0a6fda24   Volodymyr   product admin vie...
59
60
61
62
63
64
65
66
67
68
      <div class="form-group">
          <?= Html::submitButton(
              $model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'),
              [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]
          ) ?>
      </div>
      
      <?php ActiveForm::end(); ?>
  
  </div>