public function actionRegister() { $model = new User(); $profile = new Profile(); if ($model->load(Yii::$app->request->getBodyParams(), '') && $model->validate()) { if ($model->validate()) { $id = $model->register(); $profile->createProfile($id); return ['success' => true]; } } else { return $model; } }
public function actionRegister() { $model = new Register(); $profile = new Profile(); if ($model->load(Yii::$app->request->post())) { if ($model->validate()) { if ($id = $model->register()) { $profile->createProfile($id); return $this->goHome(); } } } return $this->render('register', ['model' => $model]); }