REST风格的持久性解决方案与Backbone.js的可用...在PHP? [英] A RESTful persistence solution usable with backbone.js... in PHP?

查看:103
本文介绍了REST风格的持久性解决方案与Backbone.js的可用...在PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要preface这跟说,我是一个蹩脚的程序员,我敢肯定,我想做的事情在10日线节点或Rails或者别的什么可以做,但是PHP是我有可用的。

I'll preface this with saying that I'm a crappy programmer, I'm sure that what I want to do could be done in 10 lines of node or Rails or something else, but PHP is what I have available.

所以,我希望能找到它包装看起来类似于REST风格的模型的API中的数据库调用一个简单的PHP库。

So, I'm hoping to find a simple PHP library which wraps the database calls in an API that looks similar to the RESTful model.

我已经收效甚微试图找到这样的事情 - 寻找 PHP CRUD PHP REST 转了几个数不胜数的页面,我不知道如何通过它们进行过滤。

I've had little success trying to find such a thing -- searching for PHP CRUD or PHP REST turns up several zillion pages, and I've no idea how to filter through them.

我真的试图让事情变得简单在这里,我不希望像Zend公司或一些大的框架。我在骨干处理的模型是非常简单的。我只是想送 GET s到,比方说, /笔记/ 3 POST s到 /笔记等,并有PHP做正确的事情到数据库。

I'm really trying to keep things simple here, I don't want a big framework like Zend or something. The models I'm dealing with in Backbone are really simple. I just want to send GETs to, say, /notes/3 or POSTs to /notes, etc, and have PHP do the right thing to a database.

也许我要求太多,但在我看来,这是个什么样子的Rails等框架提供。有什么建议么? TIA ...

Perhaps I'm asking too much, but it seems to me that this is what other frameworks like Rails provide. Any suggestions? TIA...

推荐答案

codeigniter ,对我来说,是最容易的Rails的类似框架。这是光秃秃的骨头,你可以很容易地从头开始构建一个CRUD应用程序。

Codeigniter, to me, is the easiest of the Rails-like frameworks. It's bare bones, and you can build a CRUD app from scratch easily.

与滚动自己的应用程序的最大的问题就是安全性。 codeigniter可以帮助您从许多常见的安全隐患,保护您打造一个不太容易被破解的网站,如直接使用$ _POST数组,而不是正确地过滤数据。更何况许多辅助类它提供了诸如表单验证。

The biggest issue with rolling your own app is security. Codeigniter can help you build a less hackable site by shielding you from many of the common security risks, such as using $_POST arrays directly, and not properly filtering your data. Not to mention the many helper classes it offers such as form validation.

您可以查看他们的网站上的文档。这很容易,只要你还记得导航在每个页面的顶部隐使用。 :D

You can view the documentation on their website. It's very easy to use as long as you remember the navigation is hidden at the top of each page. :D

这篇关于REST风格的持久性解决方案与Backbone.js的可用...在PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆