CodeIgniter Forums

Full Version: CI and fpdf/fpdi
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Yesterday I got Fpdf and Fpdi working within the CI framework.

Currently to access the classes I am doing this.


//now do something with them

My question is how to make multiple instances? Outside of CI i would do it like this

$pdf1 = new fpdi();

$pdf2 = new fpdi();

Do I need make two seperate models? or what?

Thanks in advance.


El Forum

The third parameter in load in loading a library is used to assign the class to a different name.

It's in the userguide:
Quote:Assigning a Library to a different object name

If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it will be assigned to a variable named $this->session.

If you prefer to set your own class names you can pass its value to the third parameter

El Forum