mdmsoft / yii2-admin

Auth manager for Yii2 (RBAC Manager)
GNU General Public License v3.0
1.16k stars 574 forks source link

Use own login view #451

Open strtob opened 3 years ago

strtob commented 3 years ago

Hi guys,

Maybe it's a stupid question, a short answer would be helpful, nevertheless...

I want to you use my own login view - what I have change in the config?

Thanks a lot! Toby

sihar commented 3 years ago

I try to answer Have you try change your login view in folder views/site/login? Or you mean something else?

strtob commented 3 years ago

Great! Currently, I have my own theme configured in components > view >theme > pathMap > @app/view

I want to change the view which appears in url /admin/user/login this use @vender/mdmsoft/yii2-admin/views/user/login

If I try /site/login the error "Incorrect username password" appears.

How can I use my own view or make this working with the yii2-admin module? :-/

A further questition: Is it possible to make a difference in the used layout file between guests and users?

Update, if anybody helps to change default view: 'on beforeRequest' => function ($event) { Yii::$app->layout = Yii::$app->user->isGuest ? '@app/themes/adminlte3/layouts/main-login.php' : // or just use 'GuestUser' and '@app/themes/adminlte3/layouts/layouts/main.php'; // 'RegisteredUser' since the path // and the extension are used by // default },

but problem 'incorrect username password' still exist / I need to route the request to yii2-admin controller