简体   繁体   English

数据库与codeigniter和backbone.js的交互

[英]Database interaction with codeigniter and backbone.js

I am trying to learn backbone.js to make a web application.This is my first time with a javascript framework and I am fairly confused with some of the stuff. 我正在尝试学习backbone.js来制作一个Web应用程序。这是我第一次使用javascript框架,我对一些东西感到很困惑。

I have been developing in codeigniter for a while so I do have a understanding of the MVC architecture. 我已经在codeigniter开发了一段时间,所以我对MVC架构有了解。

My question is how do I get the data from the backbone.js front end to my codeigniter controller and save it in the database. 我的问题是如何从backbone.js前端获取数据到我的codeigniter控制器并将其保存在数据库中。 for example to implement a simple login/register functionality with CI and backbone, how should I proceed. 例如,为了实现CI和骨干的简单登录/注册功能,我该如何进行。 If anyone can guide me step step then that would be great or point me to the right resource. 如果有人可以指导我迈出一步那么这将是伟大的或指向我正确的资源。 Thank you. 谢谢。

PS: I know that I have to implement a REST api with my codeigniter but I don't know how? PS:我知道我必须用我的codeigniter实现REST api,但我不知道怎么做? so if someone can provide a basic controller example it'd be really helpful. 所以,如果有人可以提供一个基本的控制器示例,那将非常有帮助。

这是一个使用上面回复中提到的API的教程(由图书馆的作者自己提供) http://net.tutsplus.com/tutorials/php/working-with-restful-services-in-codeigniter-2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM