CodeIgniter Forums
Using 3 Party Libraries - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Using 3 Party Libraries (/thread-23355.html)

Using 3 Party Libraries - El Forum - 10-08-2009

Hello everybody,

I need to implement with 3 party libraries (e.g. pdf libs) in codeigniter.
When i instantiate a sub class with parameters with the folowing construct
$myInst = new MySubClass($param1, $param2)
an error withhin Loader.php calss occurs.
Is it only possible to instantiate a class like this
$this->myInst->load->library('mySubClass, $byte_order);
and pass parameters as an array? So i must modify each constructor on 3 party libs.

An other question is, if i extend a sub calss from an other sub class, then the super class will instantiated by the framework or must i load it manually?

What is the best practices to handle with 3 party libraries, instantiate sub classes and with inheritance.


Using 3 Party Libraries - El Forum - 10-08-2009

You can just put a require_once() pointing to the path of the 3rd party class, into the top of your controller that needs it. Then just instantiate with $a = new Whatever() in the normal way. If you subclass it, just require them both.

Using 3 Party Libraries - El Forum - 10-08-2009

[eluser]louis w[/eluser]
Check out this post: