After installation of advance template in yii2, I got a user registration from at the frontend but I want it to redirect to backend after registration. How can that be done???
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,
]);
}
UPDATE here is the urlmanager
'urlManager' => [
'class' => 'yii\web\urlManager',
'showScriptName' => false,
],
'urlManagerBackend' => [
'class' => 'yii\web\urlManager',
'showScriptName' => false,
'baseUrl' => 'http://localhost/ncddp/backend/web/index.php',
],