【发布时间】:2015-02-01 10:34:32
【问题描述】:
Cakephp 的 RESTful 服务以“URL.format”格式的 URL 提供,例如:“/recipes.json”或“/recipes/123.json”。 Backbone JS 的模型或集合使用“URL”格式来访问 RESTful 服务。例如:“/recipes”或“/recipes/123” 我们如何配置 Backbone 模型或集合以使用 Cakephp 的 RESTful 服务?
【问题讨论】:
-
如何将 Backbone url 更改为
"/recipes.json",这是一些答案 `stackoverflow.com/questions/9431673/… -
@Salines 当 url 为 "/recipes.json" 时,要检索 id: 123 的特定配方,则 url 将形成为 "/recipes.json/123"。这里 cakephp 需要的是“/recipes/123.json”
标签: json rest cakephp backbone.js