开发者

Cakephp and facebook

开发者 https://www.devze.com 2023-01-20 14:14 出处:网络
I have a site built with cakephp (1.3), where users can manage lists of items. I now want to develop a facebook app that will work with the data of my web-based site.

I have a site built with cakephp (1.3), where users can manage lists of items.

I now want to develop a facebook app that will work with the data of my web-based site. The facebok-app is to replicate many of the web-site's functionality (basic CRUD and more), so I would like to reuse as much code as I can from my current cake- just use a different layout, or maybe change the views.

My question is: from a software design perspective, what's the best way to go about that? Some ideas I had in mind are:

  • Add branching code in my actions to behave differently if it's running as facebook iframe
  • externalize lots of action-logic into libs, and create different actions for the facebook app which will reuse those libs, as well as views

Would love i开发者_JAVA技巧f you can come up with other ideas.


Rather than munging your core functions, could you not develop a generic 'hook' in system and then develop your facebook functionality in a separate API to take advantage of the hooks, this would be more scalable long term and keep both apps logic separate.

0

精彩评论

暂无评论...
验证码 换一张
取 消