Example #1
0
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'birth_dt')->widget(DatePicker::classname(), ['pluginOptions' => ['format' => 'dd-mm-yyyy', 'todayHighlight' => true]]);
?>

    <?php 
echo $form->field($model, 'level')->dropDownList($model->getLevelsArray());
?>

    <?php 
echo $form->field($model, 'teachers')->widget(Select2::classname(), ['data' => \app\models\Teacher::getItemsList(), 'options' => ['multiple' => true], 'pluginOptions' => ['allowClear' => true, 'tags' => false, 'tokenSeparators' => [','], 'maximumInputLength' => 255]]);
?>

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

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

</div>