<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\file\FileInput;

/* @var $this yii\web\View */
/* @var $model common\models\HomeSlider */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="home-slider-form">

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

    <?php echo '<label class="control-label">Add Image</label>';
    echo FileInput::widget([
        'model' => $model,
        'attribute' => 'images',
        'options' => [
            'multiple' => false,
            'accept'=>'image/*'
        ],
        'pluginOptions'=>['allowedFileExtensions'=>['jpg','gif','png']]
    ]);
    ?>

    <?= $form->field($model, 'smallText')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'bigText')->textInput(['maxlength' => true]) ?>

    <!--?= $form->field($model, 'links')->textInput(['maxlength' => true]) ?-->

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
