Integration between Zend Framework and Facebook Connect

旧街凉风 提交于 2019-12-14 00:26:30

问题


I'm developing a web app with zend framework and i'd like to discuss what is the best way to intergrate all the JS and FBML in a ZF project, anyone have some experience. For example, which may be a good solution for have the Facebook istante in every controllers, a front controller plugin?


回答1:


Since JS and FBML is part of the presentation layer, these would have to go into ViewHelpers. Fetching data from FB via their APIs would go into a service, like Zend_Service_Facebook. There is a proposal for both components in Ready for Review state for some time now:

  • http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_Facebook+-+Ian+Warner
  • http://code.google.com/p/zend-service-facebook/



回答2:


For all those still landing on this POST: There is a Facebook PHP SDK on github, offered by facebook now. It is quite helpfull and has a good documentation and examples. The other Projects listed above are mostly stopped or in alpha status.




回答3:


There's a Zend Framework Library that you can use to access all Facebook Methods at GitHub from your controllers and Models.

https://github.com/erickthered/Facebook-PHP-SDK-for-Zend-Framework

For the views, it's better to add the facebook JS file with the APPID and XFBML parameters to your layout/template so that you can use tags anywhere.




回答4:


If you are using zend framework 2 you can use this tutorial...

http://kdecom.blogspot.co.nz/2012/10/how-to-login-using-facebook-in-zend.html



来源:https://stackoverflow.com/questions/2355773/integration-between-zend-framework-and-facebook-connect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!