how to set default controller

Hi,can i set default controller for my admin in the backend ?

in backend it has sitecontroller,and I created admin controller I want to redirect the user if his role is admin,to my admin controller.is this possible or the sitecontroller should be use ?

Thank you in advance.

You mean the "defaultRoute" of the application, you can set the "defaultRoute" value in backend/config/main.php




return [

    ...

    'defaultRoute' => 'admin',

    'components' => [...]

];



See here for more: https://github.com/yiisoft/yii2/blob/master/docs/guide/structure-controllers.md#default-controller-