Welcome Guest, Not a member yet? Register   Sign In
Best Practice for instantiating classes in Libraries that are non-singletons?
#10

[eluser]Jelmer[/eluser]
Good point Wanwizard, I forgot about that function. Though I'm not sure about how you put it.

For that first instance you need to put it like this:
Code:
$instance = load_class('myclass', TRUE);
When set to FALSE it only returns TRUE after load.

I prefer the autoloader solution, but if you want to do it this way I'd use it like this:
Code:
load_class('myclass', FALSE);
$instance = new Myclass();


Messages In This Thread
Best Practice for instantiating classes in Libraries that are non-singletons? - by El Forum - 06-15-2010, 07:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB