controllers/MainController.php
public function actionSignup($defaultUrl = null)
    {
        $user = $this->module->model('User');
        $configProfileForm = [
            'user' => $user,
            'scenario' => ProfileForm::SCENARIO_CREATE,
            'captchaActionUid' => $this->uniqueId . '/' . static::$captchaActionId,
        ];
        $model = $this->module->model('ProfileForm', [$configProfileForm]);

        $post = Yii::$app->request->post();
        $loaded = $model->load($post);
        if ($loaded && $model->save(true)) {
            $this->sendSignupEmail($model);
            if ($defaultUrl === null) {
                $defaultUrl = Yii::$app->getHomeUrl(); // not null because sometimes go back to signup (without POST) will error
            }
            return $this->goBack($defaultUrl);
        } else {
            return $this->render('profile-form', [
                'model' => $model,
            ]);
        }
    }
public function actionSignup($defaultUrl = null)
    {
        $user = $this->module->model('User');
        $configProfileForm = [
            'user' => $user,
            'scenario' => ProfileForm::SCENARIO_CREATE,
            'captchaActionUid' => $this->uniqueId . '/' . static::$captchaActionId,
        ];
        $model = $this->module->model('ProfileForm', [$configProfileForm]);

        $post = Yii::$app->request->post();
        $loaded = $model->load($post);
        if ($loaded && $model->save(true)) {
            $this->sendSignupEmail($model);
            if ($defaultUrl === null) {
                $defaultUrl = Yii::$app->getHomeUrl(); // not null because sometimes go back to signup (without POST) will error
            }
            return $this->goBack($defaultUrl);
        } else {
            return $this->render('profile-form', [
                'model' => $model,
            ]);
        }
    }
public function actionSignup ( $ defaultUrl = null ) { $ user = $ this -> module -> model ( 'User' ) ; $ configProfileForm = [ 'user' => $ user , 'scenario' => ProfileForm :: SCENARIO_CREATE , 'captchaActionUid' => $ this -> uniqueId . '/' . static :: $ captchaActionId , ] ; $ model = $ this -> module -> model ( 'ProfileForm' , [ $ configProfileForm ] ) ; $ post = Yii :: $ app -> request -> post ( ) ; $ loaded = $ model -> load ( $ post ) ; if ( $ loaded && $ model -> save ( true ) ) { $ this -> sendSignupEmail ( $ model ) ; if ( $ defaultUrl === null ) { $ defaultUrl = Yii :: $ app -> getHomeUrl ( ) ; // not null because sometimes go back to signup (without POST) will error } return $ this -> goBack ( $ defaultUrl ) ; } else { return $ this -> render ( 'profile-form' , [ 'model' => $ model , ] ) ; } }
Create user's profile.
@param string|array $defaultUrl return URL after signup
@return mixed
Create user s profile .