donglinxi1467 2015-02-14 12:29
浏览 41
已采纳

Symfony2 + NodeJS + AngularJS?

I want to start the development of an real time and single-page application with authentification, actions, and notifications.

Is it possible to make the back-end treatment with Symfony whom I know well, and to add NodeJS / AngularJS by above?

This plan will help you has to understand me. Is it possible to apply it, and is it a good practice?

enter image description here

  • 写回答

2条回答 默认 最新

  • doumi5223 2015-02-14 13:02
    关注

    First, I believe we need to clarify some misunderstandings regarding the real time and AngularJS. AngularJS $http and $resource use Ajax in the background.

    To have real time communication where the server pushes information to the client (instead of responding to Ajax calls), you would have to use Websockets. There are several alternatives in this domain, for example, socket.io integrates very well with nodejs, Ratchet socketo.me is specific for PHP, or you can use a 3rd party like Pusher through github.com/pusher/pusher-angular.

    Second, you can certainly invoke PHP scripts from nodejs, however, unless you have a very specific reason to do so, it seems to me that it defeats the purpose of using nodejs. If you do not have such a requirement on use nodejs.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?