Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB