Home  >  Article  >  Backend Development  >  How to set up yii2 so that the URL does not add the module name and is routed directly to the default module? Thanks

How to set up yii2 so that the URL does not add the module name and is routed directly to the default module? Thanks

WBOY
WBOYOriginal
2016-07-06 13:51:331659browse

I have multiple modules under my frontend. How do I set up yii2 so that the URL does not add the module name and is routed directly to the default module? Thank you

Reply content:

I have multiple modules under my frontend. How do I set up yii2 so that the URL does not add the module name and is routed directly to the default module? Thank you

How to set up yii2 so that the URL does not add the module name and is routed directly to the default module? Thanks
Enter config/web.php and add the following content. Upload is the controller and index is the default module.
'defaultRoute'=>'upload/index',

You can try different modules using different entry files, and then different entry files introduce different web.php configuration files

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn