views:

587

answers:

1

Hi

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

A: 

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(); 
} 
Matt
oops.. that's one is another mistake. but i have found the real reason now. thanks for the answer.
Willy
/*Irony*/You're very kind that you shared the solution :D
Tomáš Fejfar
Isn't it just ^^ :|
Matt