Backbone.js的PUT /删除与codeigniter REST服务器问题 [英] Backbone.js PUT/DELETE problems with Codeigniter REST server
问题描述
请注意:这个问题涉及到 codeIgniter-RestServer
当我打电话从骨干model.save(),其中认沽请求路由不会得到任何PUT数据的功能。萤火显示正在发送摆正参数。然而这 - $>把('键名)始终返回false。这意味着,它应该CI的REST服务器找不到PUT数据。
在另一方面,如果我设置:
Backbone.emulateJSON = TRUE;
我可以工作,作为骨干然后将发送一个名为模式的单一属性下的所有放置数据,使用这种方式$这个 - >把('模型');作品
然后所产生的额外避免费劲的是:
$数据= json_de code($这个 - >把('模型'),TRUE); //获得正常的行为#sucks
我正在运行到这个问题,也是推了解决问题的几个变化:
https://github.com/philsturgeon/$c$cigniter-restserver/pull / 84
NOTE: This question is related to CodeIgniter-RestServer
When I call model.save() from backbone the function where the put request is routed doesn't gets any PUT data. Firebug shows right PUT parameters being sent. However $this->put('keyname') always returns false. Which means CI's REST Server can't find PUT data as it should.
On the other hand, If I set:
Backbone.emulateJSON = true;
I can work, as then Backbone will send all PUT data under a single attribute named "model", using this way $this->put('model'); works
Then the extra effor involved is:
$data = json_decode($this->put('model'),true); // to get normal behavior #sucks
I was running into this issue as well and pushed a few changes that fix the problem: https://github.com/philsturgeon/codeigniter-restserver/pull/84
这篇关于Backbone.js的PUT /删除与codeigniter REST服务器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!