Both login form and some Gii-generated model’s create form are using yii\widgets\ActiveForm:
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?> <?php $form = ActiveForm::begin(); ?>
But the resulting forms are completely differently styled:
Key differences that I have spotted:
- Validation errors are styled using
class="help-block"in DB model’s forms and with
class="invalid-feedbackin case of login form (non-DB model’s form).
- Login form has special styling for fields that are passing and are not passing validation (green and red border). DB-model form has no border at all.
- There’s a padding / margin between label and field in login form that is missing in model form.
- Submit button has a padding / margin above (between it and the previous field) in login form while in model form it is directly “glued” to the last field.
- Etc., etc.
Why is that? Where’s the magic that controls that? What changes or steps must I undertake to have all my model’s forms styled in exactly the same way as I have my login form styled?