Exemplo n.º 1
0
                <?php 
echo $form->field($model, 'email');
?>

                <?php 
if ($module->enableGeneratingPassword == false) {
    ?>
                    <?php 
    echo $form->field($model, 'password')->passwordInput();
    ?>
                <?php 
}
?>

                <?php 
echo Html::submitButton(Yii::t('user', 'Sign up'), ['class' => 'btn btn-success btn-block']);
?>

                <?php 
ActiveForm::end();
?>
            </div>
        </div>
        <p class="text-center">
            <?php 
echo Html::a(Yii::t('user', 'Already registered? Sign in!'), ['/user/security/login']);
?>
        </p>
    </div>
</div>
 /**
  * Performs ajax validation.
  * @param Model $model
  * @throws \yii\base\ExitException
  */
 protected function performAjaxValidation(Model $model)
 {
     if (\Yii::$app->request->isAjax && $model->load(\Yii::$app->request->post())) {
         \Yii::$app->response->format = Response::FORMAT_JSON;
         echo json_encode(ActiveForm::validate($model));
         \Yii::$app->end();
     }
 }