register.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. * This file is part of the Dektrium project.
  4. *
  5. * (c) Dektrium project <http://github.com/dektrium>
  6. *
  7. * For the full copyright and license information, please view the LICENSE.md
  8. * file that was distributed with this source code.
  9. */
  10. use yii\helpers\Html;
  11. use yii\widgets\ActiveForm;
  12. /**
  13. * @var yii\web\View $this
  14. * @var dektrium\user\models\User $model
  15. * @var dektrium\user\Module $module
  16. */
  17. $this->title = Yii::t('user', 'Sign up');
  18. $this->params['breadcrumbs'][] = $this->title;
  19. ?>
  20. <div class="row">
  21. <div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
  22. <div class="panel panel-default">
  23. <div class="panel-heading">
  24. <h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
  25. </div>
  26. <div class="panel-body">
  27. <?php $form = ActiveForm::begin([
  28. 'id' => 'registration-form',
  29. 'enableAjaxValidation' => true,
  30. 'enableClientValidation' => false,
  31. ]); ?>
  32. <?= $form->field($model, 'email') ?>
  33. <?= $form->field($model, 'username') ?>
  34. <?php if ($module->enableGeneratingPassword == false): ?>
  35. <?= $form->field($model, 'password')->passwordInput() ?>
  36. <?php endif ?>
  37. <?= Html::submitButton(Yii::t('user', 'Sign up'), ['class' => 'btn btn-success btn-block']) ?>
  38. <?php ActiveForm::end(); ?>
  39. </div>
  40. </div>
  41. <p class="text-center">
  42. <?= Html::a(Yii::t('user', 'Already registered? Sign in!'), ['/user/security/login']) ?>
  43. </p>
  44. </div>
  45. </div>