Yeah, I'm struggling with the same issue.  It isn't clear as to the
best method for integrating CakePHP and the Facebook API.  This is as
far as I've gotten, and I don't think it is the best way because it
gives you access to the $facebook variable in the view and not the
other controller methods.

Since I'm building a Facebook app with no need for a www version, I'd
like access to the $facebook variable everywhere.  Any ideas?...

vendor('facebook/facebook');
class ContentController extends AppController
{
        // NAME
    var $name = 'Content';

        // VALIDATE
        var $validate = array(
                'title'  => 'VALID_NOT_EMPTY',
                'body'   => 'VALID_NOT_EMPTY'
        );

        function beforeFilter()
        {
                // FACEBOOK
                $GLOBALS['facebook_config']['debug'] = NULL;
                $api_key = "xxx";
                $secret = "xxx";
                $facebook = new Facebook($api_key, $secret);
                $this->set('facebook', $facebook);
        }

        ...
}





On Aug 3, 10:40 am, thequietlab <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm curious if there exists anything similar to rfacebook (http://
> rfacebook.rubyforge.org/) for cakephp ?
>
> I'm starting to build facebook port for my cake application, does
> anyone have any experience with making this combination work ?
>
> I found this little article 
> :http://www.zenperfect.com/2007/07/24/facebook-api-with-cakephp/
> but nothing more.
>
> Best,
> Andrzej


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to