Log in with Facebook classes/namespaces

Hi. I am trying to implement Log in with Facebook button and Facebook SDK. I have installed the SDK with composer, and i have included the composer autoload in bootstrap.

My bootstrap and session controller are here: http://pastebin.com/kxiGFTDD .

Facebook says : If you're using the autoloader as part of Composer, the Facebook namespace will be available for use without adding require statements for all of the files. But still I get errors like Class 'Facebook' not found in index.php and Class 'FacebookSession' not found in SessionController.

I think I am missing something really simple : including classes, namespaces, accessing them wrong way, but I really dont know which of theese and need some help :D



10.3k

I really need some help on this one :( Bump



83.4k

This means you're loading the file from the root of your filesystem, is this ok?

require_once '/../vendor/autoload.php';


9.7k

if your controller use namespace, just add blackslash before classname

        \FacebookSession::setDefaultApplication('xxx', 'xxx');
        $helper = new \FacebookRedirectLoginHelper('index/index');