yuxunbin / yafphp

Automatically exported from code.google.com/p/yafphp
0 stars 0 forks source link

配置中defaultModule不起作用 #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
如题

Original issue reported on code.google.com by MaxSpeed...@gmail.com on 12 Nov 2011 at 3:32

GoogleCodeExporter commented 9 years ago
能举个例子么?
另外, module在设置为default以后, 
还需要设置application.modules来指明加载的module
谢谢

Original comment by larue...@gmail.com on 15 Nov 2011 at 3:35

GoogleCodeExporter commented 9 years ago
我的application.ini:
application.dispatcher.defaultModule=dashboard
application.modules=dashboard

然后访问:http://localhost/出现错误

尝试修改Bootstrap.php后生效:
    public function _initRoute(Yaf_Dispatcher $dispatcher) {
        $route = new Yaf_Route_Rewrite('/', array(
                    'module' => 'dashboard',
                    'controller' => 'Index',
                    'action' => 'index',
                ));
        $router = Yaf_Dispatcher::getInstance()->getRouter()->addRoute('default', $route);;
    }

Original comment by MaxSpeed...@gmail.com on 16 Nov 2011 at 12:45