我有以下路线:
原文链接:https://www.f2er.com/php/137541.html$gridRoute = new Zend_Controller_Router_Route( ':module/:controller/list/:order/:dir/:page',array ( 'module' => 'default','controller' => 'index','order' => '','dir' => 'asc','page' => 1,'action' => 'list' ),array ( 'page' => '\d+' ) ); $router->addRoute('grid',$mainRoute->chain($gridRoute));
我希望能够为此路由添加可选参数’filter’.所以我可以使用以下网址:
http://example.org/default/list/filter/all/lname/asc/1
要么
http://example.org/default/list/lname/asc/
要么
http://example.org/default/list/filter/all
任何一个都应该工作.我试图在Route中放置一个可选参数但是没有用.有任何想法吗?