Angularjs在Symfony2的应用 [英] Angularjs on a symfony2 application

查看:70
本文介绍了Angularjs在Symfony2的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,它使用大量的JavaScript在前端的应用SF2

I'm working on a SF2 application that uses a lot of javascript on the front end.

SF2为我建立一个很好的REST应用的一个很好的方式,管理我的学说,用树枝为模板等数据库,但我想用Angularjs。

SF2 provides me a good way of building a nice REST app, manage my database with doctrine, use twig for templates and so on, but I would like to use Angularjs.

我知道angularjs的SF2与不同的方法2种不同的框架,但我想知道什么是最好的方法,使这项工作。

I know that angularjs an SF2 are 2 different framework with different approach, but I'm wondering what the best way to make this work is.

它甚至值得吗?

如果是,你认为什么是清洁和最有效的解决方案?

If yes, what do you think is the cleaner and most efficient solution?

也许使用PHP,而不是为枝条模板使用angularjs花括号?

Maybe use php instead of twig for templates to use angularjs curly braces ?

推荐答案

我觉得的Symfony2 可以完美地与正常工作 AngularJS 。证明我使用Symfony的一面,而在另一侧AnglularJS一个web应用程序做的API。

I think Symfony2 can perfectly work well with AngularJS. Proof is I'm making an API on one side using Symfony, and a web app on the other side with AnglularJS.

此外,由于某些原因我产生我的意见,我的web应用程序与。我简单地嵌入角的花括号中的一个树枝 {%逐字%} {%endverbatim%} 语句每次我需要在我的看法使用角度。

Moreover, for some reasons I generate my views in my web app with Twig. I simply embed angular's curly braces in a twig {% verbatim %} {% endverbatim %} statement each time I need to use Angular in my views.

这篇关于Angularjs在Symfony2的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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