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

View file not found #213

Closed
dtmw8z opened this issue May 11, 2020 · 5 comments
Closed

View file not found #213

dtmw8z opened this issue May 11, 2020 · 5 comments

Comments

@dtmw8z
Copy link

dtmw8z commented May 11, 2020

image

Done all the config according to the instructions given but It gives error when I try to access \user\login. Even enabled preety urls.
Is there different way to access if I have theming enabled?

@amnah
Copy link
Owner

amnah commented May 11, 2020

whats the entire error message? what does your config look like?

@amnah
Copy link
Owner

amnah commented May 11, 2020

try adding this pathMap as well

'components' => [
    'view' => [
        'theme' => [
            'pathMap' => [
                '@vendor/amnah/yii2-user/views' => '@app/views/user', // example: @app/views/user/default/login.php
            ],
        ],
    ],
],

@amnah
Copy link
Owner

amnah commented May 11, 2020

actually this might just be because of your weird view theme. you may need to customize the layout param

Because layouts are also views, they can be created in the similar way as normal views. By default, layouts are stored in the directory @app/views/layouts. For layouts used within a module, they should be stored in the views/layouts directory under the module directory. You may customize the default layout directory by configuring the yii\base\Module::$layoutPath property of the application or modules.

https://www.yiiframework.com/doc/guide/2.0/en/structure-views#layouts

@dtmw8z
Copy link
Author

dtmw8z commented May 11, 2020

Okay...This may help me....I will try this.....Thanks

@dtmw8z
Copy link
Author

dtmw8z commented May 12, 2020

If anyone gets here in future, This was actually caused by not having the main layout as main.php (we had it as base.php). And as layouts are also views so it says view file not fould.
So, just rename your main layout to main.php and it will work.

Great work by the developer ..

Thank you

@dtmw8z dtmw8z closed this as completed May 12, 2020
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