Zend Route,无需更改参数即可更改动作

问题描述

| 1:我需要更改此链接(操作索引) 本地:8080 / default / acc / index / PageDate / 2011-05-01 / ServerId / 1 / 其他(动作捕捉) 本地:8080 / default / acc / catch / PageDate / 2011-05-01 / ServerId / 1 / 2:我需要为各种变量设置认参数。例如,我不会使用此链接 本地:8080 / default / acc / catch / PageDate / 2011-05-01 / ServerId / 1 / 要么 本地:8080 / default / acc / catch / PageDate / 2011-05-01 / 要么 本地:8080 / default / acc / catch / ServerId / 1 / 像这样
$route =  new Zend_Controller_Router_Route_Regex(
            \'default/accountant/index ???\',array(
                  \'module\' => \'default\',\'controller\' => \'acc\',\'action\' => \'catch\',\'ServerId\' => 0,\'PageDate\' => \'2011-01-01\',// and  many others
            ),array(

            ),\'default/acc/index/\'
        );
但是我不知道该怎么做。     

解决方法

        要将索引动作转发为catch动作,请在索引动作内部使用
_forward
方法。 为了匹配第2点中提到的多个URL,完全不要使用任何路由器。 Zend也会自动将这些参数路由到适当的控制器和带有参数值的动作。