如何编写加载到具有对象的类并在每个类方法中可访问的供应商?
App::import('Vendor', 'facebook', array('file' => 'facebook/facebook.php'));
$facebook = new Facebook(array(
'appId' => XXXXXXXXX,
'secret' => XXXXXXXXXXXXXXX,
));
class test_controller {
function A() {
$facebook->showUser()
}
function B() {
$facebook->showUser();
}
}