yii2怎么设置,url不加模块名,直接路由到默认模块?谢谢

WBOY
Release: 2016-07-06 13:51:33
Original
1633 people have browsed it

我frontend下有多个模块,yii2怎么设置,url不加模块名,直接路由到默认模块?谢谢

回复内容:

我frontend下有多个模块,yii2怎么设置,url不加模块名,直接路由到默认模块?谢谢

yii2怎么设置,url不加模块名,直接路由到默认模块?谢谢
进入config/web.php,添加以下内容就可以了,upload是控制器/index是默认模块
'defaultRoute'=>'upload/index',

你可以试试看不同的模块使用不同的入口文件,然后不同的入口文件引入不同的web.php配置文件

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!