dro60731 2010-03-16 11:26
浏览 58
已采纳

使用Zend Framework的Facebook PHP API

I am using Zend_Framework's Zend_Controller_Action to build a facebook application. I followed the step by step of this blog for guide : http://blog.madarco.net/91/build-a-facebook-application-with-zend-framework/

public function indexAction() {
   require_once('facebook.php');
   $fb = new Facebook('1234567', '7654321');
   $user_id = $this->fb->require_login();
}

But the result is that the page went blank. Nothing happened.

As I use Smarty for the 'viewing' part, later I tried this following code :

{php}
require_once('facebook.php');
$facebook = new Facebook('1234567','7654321');
$user_id = $facebook->require_login();
{/php}

And it works.

I wonder what is wrong when I use Zend Framework to access Facebook API. Please help me on this one.

Thanks

  • 写回答

1条回答 默认 最新

  • douzhi6160 2010-03-16 11:30
    关注

    Try

    public function indexAction() { 
       require_once('facebook.php'); 
       $fb = new Facebook('1234567', '7654321'); 
       $user_id = $fb->require_login(); 
    } 
    

    (or on the other side of things...)

    public function indexAction() { 
       require_once('facebook.php'); 
       $this->fb = new Facebook('1234567', '7654321'); 
       $user_id = $this->fb->require_login(); 
    } 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应