_form_common.php
1.56 KB
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
59
60
61
<?php
use artbox\catalog\models\Product;
use artbox\catalog\models\ProductLang;
use artbox\core\components\imagemanager\components\ImageManagerInputWidget;
use artbox\core\widgets\LanguageForm;
use yii\web\View;
use yii\widgets\ActiveForm;
/**
* @var ProductLang[] $modelLangs
* @var Product $model
* @var ActiveForm $form
* @var View $this
*/
?>
<?= $form->field($model, 'sku')
->textInput() ?>
<?php
echo $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
]
);
?>
<?= LanguageForm::widget(
[
'modelLangs' => $modelLangs,
'formView' => '@artbox/catalog/views/variant/_form_language',
'form' => $form,
]
) ?>
<?= $form->field($model, 'price')
->textInput() ?>
<?= $form->field($model, 'price_old')
->textInput() ?>
<?= $form->field($model, 'stock')
->textInput() ?>
<?= $form->field($model, 'sort')
->textInput() ?>
<?= $form->field($model, 'status')
->checkbox(
[
'class' => 'flat',
]
) ?>