0
votes

I am trying to do facebook login in cakephp. I am able to login successfully but can't retrieve user info. I am using the facebook plugin from the following link:

https://github.com/webtechnick/CakePHP-Facebook-Plugin

app controller:

 class AppController extends Controller {


var $helpers=array('Session','facebook.facebook');

//var $components = array('Session','facebook.Connect');

function beforeFilter()
{
    //$this->set('facebook_user',$this->Connect->user('email'));
}

when i uncomment the components line i get the following error:

call_user_func_array() expects parameter 1 to be a valid callback, class 'Facebook' does not have a method 'getSession' [APP\Plugin\Facebook\Lib\FB.php, line 34]

view.ctp

echo $this->Facebook->login();

how do i solve this?

1

1 Answers

0
votes

Waht cake version are you using..?

in your bootstrap:

//app/Config/bootstrap.php
CakePlugin::load('Facebook');

in your appcontroller:

public $helpers = array('Facebook.Facebook');

Bare in mind to use CAPITAL letters