Php Zend_路由器,路由到indexController/转发(当提供参数时)

Php Zend_路由器,路由到indexController/转发(当提供参数时),php,zend-framework,Php,Zend Framework,有没有办法告诉Zend Framework路由器: 调用“如果www.domain.com/test” 转发到indexController- forwardAction并接收参数 “如果www.domain.com”是 称为show indexController/ 指数化 ?将此功能设置到引导文件中或存储车辙的任何位置: protected function _initRouter() { $this->bootstrap('frontController'); $fron

有没有办法告诉Zend Framework路由器:

  • 调用“如果www.domain.com/test” 转发到indexController- forwardAction并接收参数
  • “如果www.domain.com”是 称为show indexController/ 指数化

将此功能设置到引导文件中或存储车辙的任何位置:

protected function _initRouter()
{
  $this->bootstrap('frontController');
  $front = $this->getResource('frontController');
  $router = $front->getRouter();

  $router->addRoute('testToForward',
                      new Zend_Controller_Router_Route(
                          ':parameter',
                          array(
                              'controller' => 'index',
                              'action'     => 'forward',
}
编辑:通过这种方式,传递的参数将作为“参数”传递给正向控制器。
默认情况下提供第二条路由。

对不起,我的失败:我的意思是每次提供参数(如test或hello)时,都会选择索引/转发路由。