• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
load class and not instantiate

#6
[eluser]ColonelChlorine[/eluser]
Bit of an old thread, but thought I'd throw my 2c in because I ran into the same issue creating my own library which I didn't want CI to interfere with.

I didn't try extending the Common.php file (I don't even think you can because it's just a collection of functions) ... however I wrote my own loader. Threw it in as a helper. It basically accepts a class name, looks for it in the APPPATH."classes" folder and does a require_once().

That's not far off how CI does it's loader, except it does all the singleton + instantiation crap as well.

Works like a charm for me.


Messages In This Thread
load class and not instantiate - by El Forum - 05-13-2011, 02:06 PM
load class and not instantiate - by El Forum - 05-14-2011, 03:20 AM
load class and not instantiate - by El Forum - 05-14-2011, 04:03 AM
load class and not instantiate - by El Forum - 05-14-2011, 04:09 AM
load class and not instantiate - by El Forum - 05-14-2011, 05:10 AM
load class and not instantiate - by El Forum - 01-19-2012, 08:49 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.