2015-07-01 17:48:44 4626次浏览 1条回答 1 悬赏 0 金钱

新建了一个modules 程序默认走的Default控制 怎么设置让它默认访问Set 控制器呢
4.jpg

最佳答案

  • 师阳 发布于 2015-07-01 23:01 举报

    在你的 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';
    
    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
路人甲
见习主管

路人甲

注册时间:2015-06-24
最后登录:2017-09-26
在线时长:11小时13分
  • 粉丝3
  • 金钱125
  • 威望0
  • 积分235

热门问题