Good mor(eve)ning guys. My question is a bit general: How can I adapt any PHP library (like facebook sdk for example) to use in CodeIgniter?
Generally, when you download a PHP library and look to the examples provided, you load the library using include or require_once. What are the adjustments (and ways) to use $this->load->library($name, $params)?
And how can I use the library after that: replacing $var = new Library($data) by ???
If my question is not yet clear, please notify me.
(bonus question: How to apply this to facebook-sdk ?)
Thanks in advance.
create a Facebook_lib.php in the libraries root with the content:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once 'facebook/facebook.php';
class Facebook_lib extends Facebook{}
in controller:
$this->load->library('facebook_lib',$config);
$this->facebook_lib->clearAllPersistentData();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With