_form.php
1.5 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
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use backend\models\Importers;
/* @var $this yii\web\View */
/* @var $model common\models\Details */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="details-form">
<?php $form = ActiveForm::begin();
// первый элемент массива должен быть пустым
$arr_importers = [ null => '' ];
$arr_importers = array_merge( $arr_importers, ArrayHelper::map( Importers::find()->orderBy('name')->all(), 'id','name' ) );
?>
<?= $form->field($model, 'IMPORT_ID')->dropDownList( $arr_importers ) ?>
<?= $form->field($model, 'BRAND')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'ARTICLE')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'FULL_ARTICLE')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'PRICE')->textInput() ?>
<?= $form->field($model, 'DESCR')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'BOX')->textInput() ?>
<?= $form->field($model, 'ADD_BOX')->textInput() ?>
<?= $form->field($model, 'GROUP')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Добавить' : 'Редактировать', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?= Html::a('Вернуться', ['index'], ['class' => 'btn btn-primary']) ?>
<?php ActiveForm::end(); ?>
</div>