Пример #1
0
 public function actionRegister()
 {
     if (!$this->module->enableRegistration) {
         throw new NotFoundHttpException();
     }
     //        $model = \Yii::createObject(User::className());
     $model = \Yii::createObject(RegistrationForm::className());
     $this->performAjaxValidation($model);
     if ($model->load(\Yii::$app->request->post()) && $model->register()) {
         return $this->render('/message', ['title' => \Yii::t('user', 'Your account has been created'), 'module' => $this->module]);
     }
     return $this->render('register', ['model' => $model, 'module' => $this->module]);
 }
 /**
  * Displays the registration page.
  * After successful registration if enableConfirmation is enabled shows info message otherwise redirects to home page.
  *
  * @return string
  * @throws \yii\web\HttpException
  */
 public function actionRegister()
 {
     if (!$this->module->enableRegistration) {
         throw new NotFoundHttpException();
     }
     /** @var RegistrationForm $model */
     $model = Yii::createObject(RegistrationForm::className());
     $this->performAjaxValidation($model);
     if ($model->load(Yii::$app->request->post()) && $model->register()) {
         return $this->redirect(['settings/profile']);
     }
     return $this->render('register', ['model' => $model, 'module' => $this->module]);
 }