login.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /** @var yii\web\View $this */
  3. /** @var yii\bootstrap4\ActiveForm $form */
  4. /** @var app\models\LoginForm $model */
  5. use yii\bootstrap4\ActiveForm;
  6. use yii\bootstrap4\Html;
  7. $this->title = 'Login';
  8. $this->params['breadcrumbs'][] = $this->title;
  9. ?>
  10. <div class="site-login">
  11. <h1><?= Html::encode($this->title) ?></h1>
  12. <p>Please fill out the following fields to login:</p>
  13. <?php $form = ActiveForm::begin([
  14. 'id' => 'login-form',
  15. 'layout' => 'horizontal',
  16. 'fieldConfig' => [
  17. 'template' => "{label}\n{input}\n{error}",
  18. 'labelOptions' => ['class' => 'col-lg-1 col-form-label mr-lg-3'],
  19. 'inputOptions' => ['class' => 'col-lg-3 form-control'],
  20. 'errorOptions' => ['class' => 'col-lg-7 invalid-feedback'],
  21. ],
  22. ]); ?>
  23. <?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?>
  24. <?= $form->field($model, 'password')->passwordInput() ?>
  25. <?= $form->field($model, 'rememberMe')->checkbox([
  26. 'template' => "<div class=\"offset-lg-1 col-lg-3 custom-control custom-checkbox\">{input} {label}</div>\n<div class=\"col-lg-8\">{error}</div>",
  27. ]) ?>
  28. <div class="form-group">
  29. <div class="offset-lg-1 col-lg-11">
  30. <?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
  31. </div>
  32. </div>
  33. <?php ActiveForm::end(); ?>
  34. </div>