A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

CakePHP Facebook Component

A simple CakePHP component that uses the Facebook PHP SDK (https://github.com/facebook/facebook-php-sdk).

Setup the component like this:

public $components = array(
    'Facebook' => array(
        'appId' => 'xxx',
        'secret' => 'xxx',
        'cookie' => true,
        'fileUpload' => 1,
        'canvas' => 1,
        'fbconnect' => 1,
        'display' => 'page',
        'scope' => 'user_about_me,email,publish_actions,publish_stream,photo_upload',
        'redirect_uri' => 'https://www.facebook.com/pages/My-Test-Page/12345?id=12345&sk=app_12345'
    )
);

Then you should be able to do this in your controllers:

debug($this->userProfile);
debug($this->loginUrl);
debug($this->logoutUrl);
debug($this->hasLiked);
debug($this->signed_request);

Grab it from Github: https://github.com/wenbert/CakePHP-Facebook-Component

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>