load(Yii::$app->request->post())) { if (Yii::$app->request->isAjax) { Yii::$app->response->format = Response::FORMAT_JSON; return ActiveForm::validate($model); } if ($user = $model->signup()) { if (Yii::$app->getUser()->login($user)) { return $this->goHome(); } } } return $this->render('signup', [ 'model' => $model, 'module' => $this->module ]); } public function actionConfirm($id, $code) { $user = User::findIdentity($id); if ($user === null || $this->module->enableConfirmation == false) { throw new NotFoundHttpException(); } list($success, $message) = $user->attemptConfirmation($code); Yii::$app->session->setFlash($success ? 'success' : 'error', $message); return $this->redirect(['settings/basic']); } }