예제 #1
0
 /**
  * @return string|Response
  */
 public function actionSignup()
 {
     $model = new SignupForm();
     if ($model->load(Yii::$app->request->post())) {
         $user = $model->signup();
         if ($user) {
             if ($model->shouldBeActivated()) {
                 Yii::$app->getSession()->setFlash('alert', ['body' => Yii::t('yii', 'Your account has been successfully created. Check your email for further instructions.'), 'options' => ['class' => 'alert-success']]);
             } else {
                 Yii::$app->getUser()->login($user);
             }
             return $this->goHome();
         }
     }
     return $this->render('signup', ['model' => $model]);
 }