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/\'
);
但是我不知道该怎么做。
没有找到相关结果
已邀请:
1 个回复
缮淳彼誊
方法。 为了匹配第2点中提到的多个URL,完全不要使用任何路由器。 Zend也会自动将这些参数路由到适当的控制器和带有参数值的动作。