'Nissan Leaf S', 'Nissan Leaf SV' => 'Nissan Leaf SV', 'Nissan Leaf SL' => 'Nissan Leaf SL', ]; $years = [ ]; for($year = 2013; $year <= date('Y'); $year++) { $years[ $year ] = $year; } ?>
['enctype' => 'multipart/form-data']]); ?> field($model, 'model') ->dropDownList($models) ?> field($model, 'year') ->dropDownList($years) ?> field($model, 'image') ->widget(FileInput::className(), [ 'options' => [ 'accept' => 'image/*' ], 'pluginOptions' => [ 'allowedFileExtensions' => ['jpg', 'png'], 'initialPreview' => ($model->image?(Html::img($model->image, ['width' => '240px'])):false), 'initialPreviewConfig' => [ 'width' => '120px', ], 'overwriteInitial' => true, 'showUpload' => false, 'previewFileType' => 'image', ], ]) ?> field($model, 'color') ->textInput([ 'maxlength' => true ]) ?> field($model, 'mileage') ->textInput() ->label('Пробег (тыс. км.)') ?> field($model, 'build') ->widget(DatePicker::className(), [ 'dateFormat' => 'MM/yyyy', 'clientOptions' => [ 'changeMonth' => true, 'changeYear' => true, 'yearRange' => '2013:' . date('Y'), ], 'options' => [ 'class' => 'form-control', ], ]) ->label('Дата выпуска (выбор дня не влияет)') ?> field($model, 'option') ->textarea([ 'rows' => 6 ]) ?> field($model, 'price') ->textInput() ?>
isNewRecord ? 'Create' : 'Update', [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]) ?>