Welcome Guest, Not a member yet? Register   Sign In
Getting a loaded library instance: how?
#2

[eluser]dcunited08[/eluser]
Quote:[url="http://ellislab.com/codeigniter/user-guide/libraries/loader.html"]Assigning a Library to a different object name[/url]

If the third 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:
Code:
$this->load->library('session','','my_session');

// Session class is now accessed using:
$this->my_session

Use this to load the different libraries as the same name. Make sure that these libraries are written with in interface, that way you are can guarantee that the called functions will all have the same name.


Messages In This Thread
Getting a loaded library instance: how? - by El Forum - 11-06-2008, 10:46 AM
Getting a loaded library instance: how? - by El Forum - 11-06-2008, 11:42 AM
Getting a loaded library instance: how? - by El Forum - 11-06-2008, 11:45 AM
Getting a loaded library instance: how? - by El Forum - 11-06-2008, 12:54 PM
Getting a loaded library instance: how? - by El Forum - 11-06-2008, 01:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB