<?php

use yii\bootstrap\ActiveForm;
use yii\bootstrap\Html;

$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);

echo $form->field($model, 'imageFile')->fileInput(['multiple' => 'multiple']);

?>
    <img id="blah" src="#" alt="your image">
<div class="form-group">
    <?= Html::submitButton(Yii::t('app', 'Create'), ['class' => 'btn btn-success']) ?>
</div>
<?php
ActiveForm::end();
?>
<script>
    function readURL(input) {
        if (input.files && input.files[1]) {
            var reader = new FileReader();

            reader.onload = function (e) {
                $('#blah')
                    .attr('src', e.target.result)
                    .width(150);
            };

            reader.readAsDataURL(input.files[1]);
        }
    }
    $(function() {
        $(document).on('change', 'input[type=file]', function() {
            readURL(this);
        });
    });
</script>
