怎么设置模块的默认控制器 [ 2.0 版本 ]
新建了一个modules 程序默认走的Default控制 怎么设置让它默认访问Set 控制器呢 
![]()
最佳答案
- 
                                                

在你的
IndexModules.php加上public $defaultRoute = 'set';这行代码,即可。
见:
vendor/yiisoft/yii2/base/Module.php/** * @var string the default route of this module. Defaults to 'default'. * The route may consist of child module ID, controller ID, and/or action ID. * For example, `help`, `post/create`, `admin/post/create`. * If action ID is not given, it will take the default value as specified in * [[Controller::defaultAction]]. */ public $defaultRoute = 'default'; 
其他 0 个回答
没有找到数据。
路人甲
            注册时间:2015-06-24
最后登录:2017-09-26
在线时长:11小时13分
    最后登录:2017-09-26
在线时长:11小时13分
- 粉丝3
 - 金钱125
 - 威望0
 - 积分235