成功登录后我要去关于页面。没关系。
但是,URL 不会更改为 About Page。与登录页面相同,但页面内容为关于页面。
站点控制器.php
public function actionLogin()
{
if (!\Yii::$app->user->isGuest)
{
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()))
{
return $this->render('about'); // Here
}
return $this->render('login', [
'model' => $model,
]);
}
URL 与http://localhost/myProject/yii/web/index.php?r=site%2Flogin
. 它应该是http://localhost/mylawsuit/yii/web/index.php?r=site%2Fabout
那么,登录后如何更改URL。提前致谢。