Welcome Guest, Not a member yet? Register   Sign In
Getting object reference from load->library
#9

[eluser]jhabbley[/eluser]
My apologies, I now see that you're dynamically loading a library (of which you only know the name of at runtime). I apparently missed that part of your first post.

When you load each of the libraries in the loop, you can assign a custom name to the objects as you instantiate them (using the 3 argument method of the library loader.

Code:
for($i=0; $i<count($libraries); $i++) {
  $handle = 'library_'.$i
  $this->load->library($libraries[i], NULL, $handle);
  $data[$handle] = $this->$handle;
}

But yeah, that gets kind of ugly...


Messages In This Thread
Getting object reference from load->library - by El Forum - 04-02-2009, 12:00 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 12:21 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 01:03 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 01:06 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 01:14 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 01:22 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 02:28 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 02:43 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 02:45 PM
Getting object reference from load->library - by El Forum - 04-02-2009, 02:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB