在yii2提前安装模板后,我得到了一个用户注册从前端,但我想它重定向登记后到后端。 那怎么可以做???
public function actionSignup()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
if (Yii::$app->getUser()->login($user)) {
return $this->goHome(); // I WANT TO CHANGE THIS TO REDIRECT TO LOCALHOST/MYAPP/BACKEND/WEB
}
}
}
return $this->render('signup', [
'model' => $model,
]);
}
在这里更新是urlmanager
'urlManager' => [
'class' => 'yii\web\urlManager',
'showScriptName' => false,
],
'urlManagerBackend' => [
'class' => 'yii\web\urlManager',
'showScriptName' => false,
'baseUrl' => 'http://localhost/ncddp/backend/web/index.php',
],