donglinxi1467 2015-02-14 20: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 21: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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
  • dscojuxf69080 2015-02-14 22:24
    关注

    Of course yes.You can have nodejs and symfony2 in your server.you can use nodejs inside Symfony2 using CLI method.in front-end you can use angular and nodejs (converted).There is nodejs package,which lets you to convert your nodejs code to browser(browserify) side code and you can use it with angularjs.NodeJs has a package called socket.io.You can use it to have biDirectinal connection between server and client.

    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#java#的问题,请各位专家解答!(相关搜索:java程序)
  • ¥15 linux tsi721的驱动编译后 insmod 提示 报错
  • ¥20 multisim测数据
  • ¥15 求无向连通网的所有不同构的最小生成树
  • ¥15 模拟器的framebuffer问题
  • ¥15 opencv检测轮廓问题
  • ¥15 单点式登录SSO怎么爬虫获取动态SSO_AUTH_ACCESS_Token
  • ¥30 哈夫曼编码译码器打印树形项目
  • ¥20 求完整顺利登陆QQ邮箱的python代码
  • ¥15 怎么下载MySQL,怎么卸干净原来的MySQL