当前位置: 动力学知识库 > 问答 > 编程问答 >

routing - What is wrong with these Zend Framework routes from config file?

问题描述:

I was starting to get a LOT of routes in my bootstrap so I decided to move them to a config file to clean it up. I'm fairly sure I have the syntax correct, but for some reason my route won't work now. Here is my config file:

<config>

<routes>

<indextracking type="Zend_Controller_Router_Route">

<route>crid/:crid</route>

<defaults>

<controller>index</controller>

<action>index</action>

</defaults>

</indextracking>

<internetaccess type="Zend_Controller_Router_Route">

<route>internet-access</route>

<defaults>

<controller>quote</controller>

<action>index</action>

<pluginType>1</pluginType>

</defaults>

</internetaccess>

</routes>

</config>

and here is my code from my bootstrap:

protected function _initRoutes()

{

$router = Zend_Controller_Front::getInstance()->getRouter();

$router->addConfig(new Zend_Config_Xml(APPLICATION_PATH . '/configs/routes.xml'));

// More routes below. I only moved over the first two to try it out.

}

Neither of the routes from m config are registering. What am I doing wrong here?

网友答案:

Never mind. All I had to do was remove the "config" tags and it seems to be working now.

分享给朋友:
您可能感兴趣的文章:
随机阅读: