Symfony is a server-side MVC framework and solves a lot of the same domain problems that Backbone.js, et al… are interested in. In this sense no Javascript based MVC framework really integrates better or worse with Symfony.
From the perspective of MVC it may be best to focus on either a server-side (PHP/Symfony) or client-side (Javascript/various) solution and use the other to augment/support that solution. Although you could certainly blend the two I'd think that if you're starting out your time is better spent leveraging one MVC framework instead of juggling two.
One nice thing about Symfony is that it can build Coffeescript. That's kind of neat, but that's just an aside. Another thing to consider is that Node.js allows you to write server-side and client-side code in Javascript, so keep an eye out for tighter integration there.
If you're going to use Symfony as your MVC solution you'll probably want to focus on a lightweight Javascript framework that is good at DOM manipulation and asynchronous calls, like jQuery or Prototype and let Symfony do the majority of the view rendering and data CRUD.
I used jQuery and jQuery UI, but there is no special integration with Symfony. However, because jQuery is the mainstream library you'll have much more chance to have later integration coming with it.
That's what happened with Grails. It started with Prototype, but now it uses jQuery by default.
发布评论
评论(2)
Symfony 是一个服务器端 MVC 框架,解决了 Backbone.js 等人感兴趣的许多相同领域的问题。从这个意义上说,没有一个基于 Javascript 的 MVC 框架真正与 Symfony 集成得更好或更差。
从 MVC 的角度来看,最好关注服务器端(PHP/Symfony)或客户端(Javascript/各种)解决方案,并使用另一个来增强/支持该解决方案。虽然您当然可以将两者混合在一起,但我认为如果您刚开始,最好将时间花在利用一个 MVC 框架上,而不是同时兼顾两个框架。
Symfony 的一大好处是它可以构建 Coffeescript。这有点简洁,但这只是一个旁白。另一件需要考虑的事情是 Node.js 允许您用 Javascript 编写服务器端和客户端代码,因此请注意那里更紧密的集成。
如果您打算使用 Symfony 作为 MVC 解决方案,您可能希望专注于擅长 DOM 操作和异步调用的轻量级 Javascript 框架,例如 jQuery 或 Prototype,并让 Symfony 完成大部分视图渲染和数据处理增删改查。
Symfony is a server-side MVC framework and solves a lot of the same domain problems that Backbone.js, et al… are interested in. In this sense no Javascript based MVC framework really integrates better or worse with Symfony.
From the perspective of MVC it may be best to focus on either a server-side (PHP/Symfony) or client-side (Javascript/various) solution and use the other to augment/support that solution. Although you could certainly blend the two I'd think that if you're starting out your time is better spent leveraging one MVC framework instead of juggling two.
One nice thing about Symfony is that it can build Coffeescript. That's kind of neat, but that's just an aside. Another thing to consider is that Node.js allows you to write server-side and client-side code in Javascript, so keep an eye out for tighter integration there.
If you're going to use Symfony as your MVC solution you'll probably want to focus on a lightweight Javascript framework that is good at DOM manipulation and asynchronous calls, like jQuery or Prototype and let Symfony do the majority of the view rendering and data CRUD.
我使用了 jQuery 和 jQuery UI,但没有与 Symfony 进行特殊集成。然而,由于 jQuery 是主流库,您将有更多机会进行后续集成。
Grails 就是这样。它最初使用 Prototype,但现在默认使用 jQuery。
I used jQuery and jQuery UI, but there is no special integration with Symfony. However, because jQuery is the mainstream library you'll have much more chance to have later integration coming with it.
That's what happened with Grails. It started with Prototype, but now it uses jQuery by default.