Yaf_Dispatcher::setDefaultModule
(Yaf >=1.0.0)
Change default module name
Description
Change the module name which is used when a module name can not be extracted from the request URI. The module must be a registered one, see Yaf_Application::getModules.
Parameters
moduleThe name of a registered module.
Return Values
Returns the Yaf_Dispatcher object itself on success, false if the given module is not registered (and a YAF_ERR_TYPE_ERROR is triggered) or if the application is not initialized, or null otherwise.
Errors/Exceptions
Triggers a YAF_ERR_TYPE_ERROR error if module is not a registered module name.
Examples
Yaf_Dispatcher::setDefaultModule example
<?php
$app = new Yaf_Application(dirname(__FILE__) . "/conf/application.ini");
// "Home" must be a registered module, e.g. via
// application.modules = "Index,Home,Admin" in conf/application.ini
Yaf_Dispatcher::getInstance()->setDefaultModule("Home");
$app->run();
?>See Also
Yaf_Dispatcher::setDefaultControllerYaf_Dispatcher::setDefaultActionYaf_Dispatcher::getDefaultModule