CodeIgniter Forums

Full Version: Using multiple libraries together?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum


I have two libraries which I need to get to work together.

The first one EWPServices.php I can get to run fine. I load and use it in a controller using the following code.


Now here's where I'm stuck. Within the EWPServices function I call it needs to use a different library's function (PPCrypto.php). I've loaded the library in the controller along with EWPServices, but when I use $this->ppcrypto->function(); from within the EWPServices library I get a call to member function on non-object error.

It's probably something really simple, so if anyone could point it out, I would greatly appreciate it.


El Forum

I've figured it out... I added the following in my library.

public $CI;

public function __construct()
if (!isset($this->CI))
$this->CI =& get_instance();

Then called the function like this: