Redirect to a page other than login in Yii 2 behaviors

后端 未结 3 2516
旧时难觅i
旧时难觅i 2021-02-18 18:14

Is there any way to redirect to a page other than login in behaviors method in Yii 2?

My behaviors method content:

public function behaviors()
{
    retu         


        
3条回答
  •  庸人自扰
    2021-02-18 18:56

    I'm using yii2-user for user management, and the redirect to login was going to /user/login instead of the yii2-user defined /user/security/login. so my fix was to update the urlManager rules with: '' => 'user/security/'

    I guess this could be used also to redirect to some other controller/action other than login.

    See here.

提交回复
热议问题