我在使用Kohana 3.3設置RESTful API時遇到問題。我已將以下模塊(分支3.3/release/v2.0),https://github.com/michal-m/kohana-modules-restful添加到我的引導程序中。Kohana 3.3 RESTful API路由錯誤
我創建了一個新的控制器,Controller_Api
延伸RESTful_Controller
並具有get
,update
,create
,delete
行動。在我的路線文件我有:
Route::set('api', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'api',
'action' => 'index'
));
但我遇到的問題是,當我去:http://example.com/api/user/1
我收到以下錯誤這表明我的路線是錯誤的,但我不能工作了出:
Kohana_HTTP_Exception [ 404 ]: Unable to find a route to match the URI: api/user/1
我是組件創建者。你可以確認你正在使用哪個分支,它是'主'嗎? – 2013-04-25 07:01:06
@MichalM我正在使用'3.3/release/v2.0' – xylar 2013-04-25 08:22:17
我在模塊中發現了一個錯誤,可能會在區分大小寫的文件系統上導致此問題。正在修復。當它修復時會讓你知道。 – 2013-04-25 17:14:20