简体   繁体   中英

Kohana module restify URL

Hi I am trying to work with this module ->

http://kohana-modules.com/modules/michealmorgan/kohana-restify

It works great except when I use curl to send requests, if I send this

localhost/restify/test?id=1 then I get the value of id

If I do this

localhost/restify/test/1 or localhost/restify/test/index/1 I get routed to the defualt page (error page)

So I asume Index is mapped to GET,so anything thats not test/index is routed, but I cant figure out how to allow it to accept it.

Has anyone solved this?

thanks

if (trim(Request::detect_uri(), '/') == 'restify/test')
{
Route::set('restify/test', '<directory>(/<controller>(/<action>(id/<id>)))')
->defaults(array
(
'directory'     => 'restify', 
'controller'    => 'test'

try inserting this in your bootstrap...

echo Debug::vars(trim(Request::detect_uri(), '/'));

if it does not equal restify/test when you curl the request, something is up and you might need to fix the module

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM