How to change config login path

Hi Everyone!

I want to change login path, default Yii 2 set login path is ‘site/login’. I wanna to set in config change to ‘/staff/default/login’. Help me please!. Thanks so much!.

I haven’t tried yet but I think that can be solved by create a new Controller for login action.

Thanks Vinh!

I fixed it. Like Yii 1, Yii 2 config login in user component:

'user' => [

            'identityClass' => 'common\models\Staff',

            'loginUrl' => ['/staff/default/login'],

            'enableAutoLogin' => true,


Thanks for reply!.