[英]Kohana module restify URL
您好,我正在嘗試使用此模塊 ->
http://kohana-modules.com/modules/michealmorgan/kohana-restify
它工作得很好,除非我使用 curl 發送請求,如果我發送這個
localhost/restify/test?id=1 然后我得到 id 的值
如果我這樣做
localhost/restify/test/1 或 localhost/restify/test/index/1 我被路由到默認頁面(錯誤頁面)
所以我假設索引被映射到 GET,所以任何不是測試/索引的東西都會被路由,但我不知道如何讓它接受它。
有人解決了嗎?
謝謝
if (trim(Request::detect_uri(), '/') == 'restify/test')
{
Route::set('restify/test', '<directory>(/<controller>(/<action>(id/<id>)))')
->defaults(array
(
'directory' => 'restify',
'controller' => 'test'
嘗試將其插入您的引導程序中...
echo Debug::vars(trim(Request::detect_uri(), '/'));
如果在您 curl 請求時它不等於 restify/test,則說明出現了問題,您可能需要修復模塊
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.