在我的引导程序中,我有
$route = new Zend_Controller_Router_Route(
':language/:country/:controller/:action/*',
array(
'language' => 'en',
'country' => 'us',
'controller' => 'bicycle',
'action' => 'index'
),
array(
'language' => '[a-z][a-z]',
'country' => '[a-z][a-z]'
)
);
在我看来,我有
echo $this->url(array('page'=>2));
//actually this translated to $route->assemble(array('page' => 2), null, false);
问题是当我有一些 GET 参数时:在构建链接时不会考虑它们,这就是我真正想要的。
示例:我访问 URL(在浏览器中)
http://localhost/myproject/en/us/controller/action/?get1=gval1&get2=gval2&get3=gval3
组装好的网址是
http://localhost/myproject/en/us/controller/action/page/2
代替
http://localhost/myproject/en/us/controller/action/page/2/get1/gval1/get2/gval2/get3/gval3/
或(我更喜欢下一个)
http://localhost/myproject/en/us/controller/action/page/2/?get1=gval1&get2=gval2&get3=gval3
有任何想法吗?