Zend路由器配置xml,快捷方式?
我有一个这样的xmlZend路由器配置xml,快捷方式?,xml,config,router,zend-route,Xml,Config,Router,Zend Route,我有一个这样的xml <configdata> <routes> <home type="Zend_Controller_Router_Route"> <route>home</route> <defaults> <controller>index</controller>
<configdata>
<routes>
<home type="Zend_Controller_Router_Route">
<route>home</route>
<defaults>
<controller>index</controller>
<action>index</action>
</defaults>
</home>
</routes>
</configdata>
如何在配置xml中执行此操作?在bootsrap.php上
protected function _initRoutes()
{
$routefile = new Zend_Config_Xml(APPLICATION_PATH.'/routes.xml');
$router = Zend_Controller_Front::getInstance()->getRouter();
$router->addConfig($routefile);
return $router;
}
其中routes.xml文件是包含所有路由的xml文件,它必须位于应用程序文件夹中
protected function _initRoutes()
{
$routefile = new Zend_Config_Xml(APPLICATION_PATH.'/routes.xml');
$router = Zend_Controller_Front::getInstance()->getRouter();
$router->addConfig($routefile);
return $router;
}