function $dispatcher->setDefaultModule("xxx") is unable to set default module from index to others(Yaf >=1.0.0)
Yaf_Dispatcher::setDefaultModule — 更改默认模块名
更改当无法从请求 URI 中提取模块名时所使用的模块名。该模块必须是已注册的, 参见 Yaf_Application::getModules()。
module已注册模块的名称。
成功时返回 Yaf_Dispatcher 对象自身;如果给定的模块未注册或应用未初始化,则返回 false(模块未注册时会触发一个 YAF_ERR_TYPE_ERROR);其他情况返回 null。
YAF_ERR_TYPE_ERROR 错误会在 module 不是已注册的模块名时触发。
示例 #1 Yaf_Dispatcher::setDefaultModule() 示例
<?php
$app = new Yaf_Application(dirname(__FILE__) . "/conf/application.ini");
// "Home" 必须是一个已注册的模块,例如通过
// conf/application.ini 中的 application.modules = "Index,Home,Admin"
Yaf_Dispatcher::getInstance()->setDefaultModule("Home");
$app->run();
?>
function $dispatcher->setDefaultModule("xxx") is unable to set default module from index to othersfunction $dispatcher->setDefaultModule("xxx") is unable to set default module from index to othersYaf_Dispatcher::setDefaultModule is not effective.
yaf version 2.2.9