【发布时间】:2017-03-20 09:30:54
【问题描述】:
我知道我的问题标题听起来像是重复的,但事实并非如此。我们的项目是多语言的。我在此页面上有列表页面 cakephp 分页已应用。但是页码的链接是:
http://example.com/controller/action?language=en&page=8
我已经实现了路由消失动作,使用下面提到的路由代码:
$routes->connect('/controller',
['language' => 'en', 'controller' => 'controller', 'action' => 'action']
);
所以现在是:
http://example.com/controller?language=en&page=8
但我的要求是这样的
http://example.com/controller?page=8
为了实现我的目标,我实现了这段代码
$routes->connect('/controller/:page',
['language' => 'en', 'controller' => 'controller', 'action' => 'action'], ['page' => "(?page:'[0-9]+]')"]
);
提前致谢。
【问题讨论】:
-
我也需要同样的东西...
标签: php cakephp routing cakephp-3.x