【发布时间】:2012-05-08 13:55:15
【问题描述】:
我正在尝试在 Cakephp 中创建一个可以有任何前缀的路由。但我也希望管理员路由正常工作。 在这种情况下,前缀将是一种语言。 Route 必须使用 action: index 链接到名为 front 的控制器。
网址应该是这样的 www.domain.com/eng/the/rest/of/the/url_12 或 www.domain.com/nl/the/rest/of/the/url_12
这就是我所拥有的,这意味着我必须为每种语言创建一条路线,这不是我想要的。
Router::connect('/', array('controller' => 'front', 'action' => 'index'));
Router::connect('/admin', array('controller' => 'cms', 'action' => 'index', 'admin' => true));
Router::connect('/nl/*', array('controller' => 'front', 'action' => 'index'));
【问题讨论】:
标签: cakephp routes custom-routes