We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

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


I really need some help on this one :( Bump


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

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


if your controller use namespace, just add blackslash before classname

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