[eluser]Unknown[/eluser]
Thanks for the input guys, maybe it will help if I tell you what it does.
I'm building a facebook app and at the moment I have this throughout the controllers multiple times...
Code:
//Set facebook Config
$data['facebook'] = new Facebook(array(
'appId' => '204141329601359',
'secret' => '78070567a4a0de2b1cc9c6a2b493c2ce',
'cookie' => true,
));
// Get facebook session
$data['session'] = $data['facebook']->getSession();
// Try api call and get user id and user object
$data['me'] = null;
// Session based API call.
if ($data['session']) {
try {
$data['uid'] = $data['facebook']->getUser();
$data['me'] = $data['facebook']->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
}
}
Where do you think the best place to put something like that would be?