_form.php
627 Bytes
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
?>
<?php $form = ActiveForm::begin([
'id' => 'form',
'options' => ['enctype' => 'multipart/form-data'],
]); ?>
<?= $form->field($model, 'title') ?>
<?= $form->field($model, 'url') ?>
<?= $form->field($model, 'image')->fileInput() ?>
<?= $form->field($model, 'old_image')->hiddenInput(['value'=>$model->image])->label(false); ?>
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
<?php ActiveForm::end(); ?>