CodeIgniter Forums
Using multiple libraries together? - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived General Discussion (
+--- Thread: Using multiple libraries together? (/thread-31389.html)

Using multiple libraries together? - El Forum - 06-17-2010


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.


Using multiple libraries together? - El Forum - 06-17-2010

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: