<?php

use common\models\LoginForm;
use frontend\models\SignupForm;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;

?>
<div class="modal fade" id="regMe" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2">
    <div class="modal-dialog auth" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <span class="modal-title" id="myModalLabel2">Создание профиля</span>
            </div>

            <div class="modal-body">

                <?php $form = ActiveForm::begin([
                    'action'=>Url::toRoute('site/signup'),
                ]); ?>

                <div class="modal_close_btn"></div>

                <div class="title"><?= Yii::t('app', 'registration') ?></div>

                <?= $form->field(new SignupForm(), 'email', ['enableAjaxValidation' => true]) ?>

                <?= $form->field(new SignupForm(), 'username')->textInput() ?>

                <?= $form->field(new SignupForm(), 'surname')->textInput() ?>

                <?= $form->field(new SignupForm(), 'phone', ['enableAjaxValidation' => true,
                ])->textInput() ?>


                <?= $form->field(new SignupForm(), 'password')->passwordInput() ?>

                <?= $form->field(new SignupForm(), 'password_repeat')->passwordInput() ?>

                <div class="form-group">
                    <?= Html::submitButton(Yii::t('app', 'registration'), ['class' => 'my_cust_btn', 'name' => 'signup-button']) ?>
                </div>

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

            <div class="modal-footer">
            </div>

        </div>
    </div>
</div>