使用/嵌入Ember js与/在Codeigniter [英] Using/Embedding Ember js with/in Codeigniter

查看:110
本文介绍了使用/嵌入Ember js与/在Codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将在后端开始使用Ember.js作为前端技术和Codeigniter开发Web应用程序。

I am about to start developing a web application using Ember.js as front end technology and Codeigniter at backend.

我遇到的问题是如何嵌入或使用ember js与codeigniter。有可能通过webservices从代码标识符中暴露JSON对象,并从ember中使用它们。但是在这种情况下,可能会出现处理会话和Cookie的问题。我不知道是否有可能将ember嵌入到codeigniter中,并通过某种技术直接访问数据。我也在搜索网络,但没有得到任何确切的回应。

The issue on which I am struck is how to embed or use ember js with codeigniter. There is a possibility of exposing JSON objects from codeigniter through webservices and use them from ember. But in this case there can be an issue of handling sessions and cookies. I don't know whether it is possible to embed ember into codeigniter and accessing data directly with some technique. I am also searching through net but not getting any exact response.

究竟应该使用什么技术将ember js嵌入代码。

What exactly technique should be used to embed ember js into codeigniter.

谢谢。

推荐答案

基本上,与使用Ember.js的任何其他框架一样,sorta 。问题是Codeigniter没有任何内置的ORM或良好的PDO驱动程序。由于它几年没有改变,它仍然使用较旧版本的PHP,您可能很难。在Composer的帮助下,PHP库部分已经有了一些改进(尽管如此,它非常缓慢)。您可以利用一些更受欢迎的ORM,如Laravel's Enloquent。

Basically, it's the same thing as using any other framework with Ember.js, sorta. The problem is that Codeigniter doesn't have any built in ORM or good PDO drivers. Since it hasn't changed for years and it's still using an older version of PHP, you might have a hard time. There have been some improvements in the PHP library section with the help of Composer (though , it's insanely slow). You can leverage some of the more popular ORMs like Laravel's Eloquent.

几个搜索将本教程放在一起: http://mannyisles.com/using-eloquent-orm-inside-codeigniter.html

A few searches brings this tutorial up: http://mannyisles.com/using-eloquent-orm-inside-codeigniter.html

这将允许您轻松公开来自数据库的JSON对象具有不错的API。接下来要使用 Ember Data 。默认情况下,Ember Data使用RESTful API。这就是你所需要的。您将构建遵循RESTful约定的控制器和模型。

This will allow you to easily expose JSON objects that come from the database with a nice API. The next thing would be to use Ember Data. By default, Ember Data uses a RESTful API. This is what you need. You would build controllers and models that follow the RESTful convention.

基本上是这样会议都是在服务器端进行的。但是,您可以查看这些帖子来解释有关用户身份验证的信息:

That's basically it. Sessions are all worked out on the server-side. But you can check out these posts explaining things about user authentication:

使用时处理用户身份验证ember.js

框架与Ember集成没有太大区别,但是代号是一个例外。我会建议使用一个更现代的解决方案,如Laravel 4,这将使它更容易暴露JSON API。您必须使用Codeigniter做一些解决方法。

There isn't much difference between framework integrating with Ember, but codeigniter is one exception. I would suggest using a more modern solution like Laravel 4 which will make it extremely easier to expose a JSON API. You'll have to do some workarounds with Codeigniter.

这篇关于使用/嵌入Ember js与/在Codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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