Example #1
0
<?php

use yii\widgets\ActiveForm;
use yii\web\Session;
use yii\helpers\Html;
$session = new Session();
$this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title;
if ($session->hasFlash('message')) {
    ?>
<div class="alert alert-danger" role="alert"><?php 
    echo $session->getFlash('message');
    ?>
</div>
<?php 
}
?>
<div class="site-login">
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>Please fill out the following fields to login:</p>

    <?php 
$form = ActiveForm::begin(['id' => 'login-form', 'options' => ['class' => 'form-horizontal'], 'fieldConfig' => ['template' => "{label}\n<div class=\"col-lg-3\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>", 'labelOptions' => ['class' => 'col-lg-1 control-label']]]);
?>

        <?php 
echo $form->field($login, 'usr')->label("Username");