Example #1
0
/* @var $this yii\web\View */
/* @var $model common\models\Product */
/* @var $form yii\widgets\ActiveForm */
/* @var $properties \common\models\ProductProperty[] */
/* @var $videos \common\models\ProductVideo[] */
?>

<div class="product-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data'], 'id' => 'product-form', 'enableAjaxValidation' => true]);
?>
    <h2>Base info</h2>
    <div class="col-md-12 row">
        <?php 
echo $form->field($model, 'category_id')->dropDownList(Category::getRubricsDropDownItems(), ['prompt' => 'Select category']);
?>
        <?php 
echo $form->field($model, 'brand_id')->dropDownList(Brand::getDropDownItems(), ['prompt' => 'Select brand']);
?>
        <?php 
echo $form->field($model, 'title')->textInput();
?>
        <?php 
if ($model->main_photo) {
    ?>
            <?php 
    echo Html::img($model->getMainImagePath(), ['style' => 'max-height: 160px']);
    ?>
        <?php 
}