Created
February 29, 2016 07:35
-
-
Save pzzrudlf/cf119890ebf47892460c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function actionSignupForm() | |
| { | |
| $model = new SignupForm(); | |
| if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) { | |
| 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, | |
| ]); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment