Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use own login view #451

Open
strtob opened this issue Apr 7, 2021 · 2 comments
Open

Use own login view #451

strtob opened this issue Apr 7, 2021 · 2 comments

Comments

@strtob
Copy link

strtob commented Apr 7, 2021

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
Copy link
Collaborator

sihar commented Apr 8, 2021

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

@strtob
Copy link
Author

strtob commented Apr 8, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants