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

查看:131
本文介绍了使用/嵌入灰烬与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.

上我打的问题是如何嵌入或使用带有codeigniter烬JS。有通过web服务揭露从codeigniter JSON对象和从余烬使用它们的可能性。但是,在这种情况下,可以处理会话和饼干的问题。我不知道是否有可能嵌入到灰烬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.

到底什么技术应该被用来嵌入烬JS到codeigniter。

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

感谢。

推荐答案

基本上,这是同样的事情用与Ember.js其他任何框架,八九不离十。问题是,codeigniter没有任何内置的ORM还是不错的PDO驱动程序。因为它并没有改变多年,它仍然使用PHP的旧版本,你可能有一个困难时期。目前已在与作曲家的帮助PHP库部分有所改善(虽然,这是疯狂慢)。您可以利用一些比较流行的ORM像Laravel雄辩的。

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 /使用-雄辩-ORM-内 - codeigniter.html

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

这将让您轻松地揭露了来自一个不错的API数据库JSON对象。接下来的事情将是使用灰烬数据。默认情况下,子玉的数据使用一个RESTful API。这就是你所需要的。你会建立一个遵循REST风格的惯例控制器和模型。

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:


  • <一个href=\"http://stackoverflow.com/questions/12272881/best-way-to-enforce-user-authentication-state-in-ember-js-app\">Best的方式来强制执行Ember.JS应用

<一个href=\"http://stackoverflow.com/questions/10812368/handling-user-authentication-when-using-ember-js\">Handling用户认证在使用ember.js

有没有框架与Ember整合太大区别,但codeigniter是一个例外。我会建议使用像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.

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

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