facebook - How do you load third party package in Codeigniter? -
this elementary question.
i downloaded facebook php sdk , stored in "third_party" folder within codeigniter. hoping should go. how load such php sdk?
thanks
i ended sticking in in ci's libraries directory , adding libraries autoload in config/autoload.php
autoload.php:
$autoload['libraries'] = array('facebook');
then, made small change facebook implementation (constructor of facebook class) , added keys app's config file:
public function __construct() { $ci =& get_instance(); $this->setappid($ci->config->item('fb_appid')); $this->setapisecret($ci->config->item('fb_secret')); $this->setcookiesupport($ci->config->item('fb_cookie')); $this->setbasedomain($ci->config->item('fb_domain')); $this->setfileuploadsupport($ci->config->item('fb_upload')); }
...and presto - have access facebook's api in models , controllers via $this->facebook
Comments
Post a Comment