【发布时间】:2012-04-19 18:32:50
【问题描述】:
您好,我正在尝试使用此模块 ->
http://kohana-modules.com/modules/michealmorgan/kohana-restify
它很好用,除非我使用 curl 发送请求,如果我发送这个
localhost/restify/test?id=1 然后我得到 id 的值
如果我这样做
localhost/restify/test/1 或 localhost/restify/test/index/1 我被路由到默认页面(错误页面)
所以我假设 Index 被映射到 GET ,所以任何不是 test/index 的东西都会被路由,但我不知道如何让它接受它。
有人解决了吗?
谢谢
if (trim(Request::detect_uri(), '/') == 'restify/test')
{
Route::set('restify/test', '<directory>(/<controller>(/<action>(id/<id>)))')
->defaults(array
(
'directory' => 'restify',
'controller' => 'test'
【问题讨论】:
-
您必须向我们展示您的 bootstrap.php,否则我们无法为您提供帮助。
-
就是这样,我不认为它是引导程序,因为一旦模块看到 GET 它就会索引其他任何东西,例如 index/44 被发送到默认页面。这里是。 if (trim(Request::detect_uri(), '/') == 'restify/test') { Route::set('restify/test', '
(/ (/ ( id/ )))') ->defaults(array ('directory' => 'restify', 'controller' => 'test')); }