Ejemplo n.º 1
0
 public function actionRegistration()
 {
     $model = new RegistrationForm();
     if ($model->load(\Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view']);
     }
     return $this->render('registration', ['model' => $model]);
 }
Ejemplo n.º 2
0
 /**
  * @return string|\yii\web\Response
  */
 public function actionRegistration()
 {
     $model = new RegistrationForm();
     if ($model->load(\Yii::$app->request->post())) {
         if ($user = $model->save()) {
             if (Yii::$app->getUser()->login($user)) {
                 return $this->redirect(['site/index']);
             }
         }
     }
     return $this->render('registration', ['model' => $model]);
 }