【发布时间】:2018-08-15 00:43:59
【问题描述】:
我有一个动作 details 正在处理 URL:
something/details/Location/6
这很好用。不过,我想在最后添加更多细节,主要是为了 SEO。
我的 routes.yml 中有:
---
Name: mysiteroutes
---
Director:
rules:
'something//$Action/$Location/$OtherID': 'SomeController'
在我的控制器中:
private static $url_handlers = array(
'something//$Action/$Location/$OtherID' => 'handleAction'
);
如果我转到上面的 URL,它可以工作,但是如果我转到 something/details/Location/6/test,它会返回 404,即使该操作仍在加载并返回自身并返回 renderWith()
我怎样才能让它工作? ID后面的细节我也不关心。
【问题讨论】:
标签: php routing silverstripe