开发者

Facebook PHP API with Zend Framework

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 Fa开发者_StackOverflowcebook('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


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(); 
} 
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜