Home > Backend Development > PHP Tutorial > 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
Release: 2016-07-06 13:51:33
Original
1687 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template