Closed nunomaduro closed 9 years ago
Hello, The best practice in my opinion is to use multiple paths. This is clean and easy way to solve all possible situations.
From docs:
'pathMap' => [
'@app/views' => [
'@app/themes/christmas',
'@app/themes/basic',
],
]
In this case, the view will be searched in @app/themes/christmas/site/index.php then if it's not found it will check @app/themes/basic/site/index.php. If there's no view there as well application view will be used.
UPD:
A real example for admin
theme
'components' => [
...
'view' => [
'theme' => [
'class' => 'vova07\themes\admin\Theme',
'pathMap' => [
'@backend/views' => [
'@backend/themes/myThemeName/views',
'@vova07/themes/admin/views',
],
'@backend/modules' => [
'@backend/themes/myThemeName/modules',
'@vova07/themes/admin/modules'
]
]
]
]
...
]
Hello, I would like to know where to place the controller, model and view generated with crud in yii2-start. Because I have placed in the backend and I mouestra Page Not Found message. Thank you
Hi @caceresvega ,
You my put them to the default folders. Of course there are missed by default, but you can create them by your self. So models will be placed in backend/models
and controllers in backend/controllers
directory.
All like in advanced
template.
Yes, and don't forgot to add the URL
rule for your new controllers, something like: '<_c>/<_a>' => '<_c>/<_a>'
Good luck!
Thank worked properly
Dear I have tried to set yii2-start a hosting 1and1.com and I have not achieved it shows me the error of Internal Server Error and all paracer be a problem with the configuration of the .htaccess file (for locally works) thatYou have the following code:
I would appreciate if you have any ideas to help me asolucionar this problem, have the url where the site is hosting de1and1.com http://qs.redbridgeinsurance.com
My email is: caceresvega@gmail.com Thank you very much for the help you can give me Juan Alberto Caceres Vega
Hi @caceresvega ,
What is the exact internal error that you got? Check the log
file please on the server side, and provide some info about what's going wrong, because without any info I really can't help with anything.
Yes, and if it's possible, please create a new issue for this conversation. It's not related with the current issue. I'll help you there.
Hey,
What is the best option to override views ?
Example: Override header, override mail change, etc.