我的问题是我想要一些通过 URL 传递的参数值,不要触发 Zend 路由,而是导致默认的控制器/动作对。
现在我的 index.php 中有以下内容:
// *** routing info ***
$router = Zend_Controller_Front::getInstance()->getRouter();
$router->addRoute('showpage', new Zend_Controller_Router_Route('/show/:title',
array('controller' => 'Show',
'action' => 'page')));
// annoying exceptions :(
$router->addRoute('addshow', new Zend_Controller_Router_Route('/show/add',
array('controller' => 'Show',
'action' => 'add')));
$router->addRoute('saveshow', new Zend_Controller_Router_Route('/show/save',
array('controller' => 'Show',
'action' => 'save')));
$router->addRoute('addepisode', new Zend_Controller_Router_Route('/show/addEpisode',
array('controller' => 'Show',
'action' => 'addEpisode')));
$router->addRoute('saveepisode', new Zend_Controller_Router_Route('/show/saveEpisode',
array('controller' => 'Show',
'action' => 'saveEpisode')));
如果没有最后 4 个路由器,则 URL/show/add
指向show/page
,带有 title == 'add'。请,每一个帮助将不胜感激。