I'm using the great Facebook plugin for cakephp 1.3 by http://www.webtechnick.com. This is what I have at the moment:
class UsersController extends AppController {
var $name = 'Users';
var $components = array('Facebook.Connect');
function beforeFilter {
$this->set('facebookUser', $this->Connect->user());
}
}
But I want to load the Facebook.Connect component conditionally, and use it in the controller - something like this in sudocode...
if ($thisIsTrue) {
Load_the_component_and_make_it_ready_for_use;
$this->set('facebookUser', $this->Connect->user());
}
How should I do this?