Welcome Guest, Not a member yet? Register   Sign In
Instance of superobject
#1

[eluser]Unknown[/eluser]
Hi there...

Im using layout library, which prepare and render another controllers. Question: how i can most rightly to CI conception? Other - controllers are not super-objects, but they need to use super-object objects.

When i construct another controller get_instance return point to last constructed controller, e.g. Top_CI_Controller, coz self::$instance point to the $this, and $this - not superobject.

Maybe this simple fix? ('core/Controller.php')

39 if(!is_object(self::$instance))
40 self::$instance =& $this;

When i load models, they in Superobject->$class. Hmm...
Really, its confuse me.
What about conception?

Thanks, regards...
#2

[eluser]bubbafoley[/eluser]
you shouldn't load a controller in a controller if that's what you are doing. If you need to share resources between controllers you should extend the core controller class.

http://ellislab.com/codeigniter/user-gui...aries.html
http://codeigniter.com/wiki/MY_Controlle...ontroller/




Theme © iAndrew 2016 - Forum software by © MyBB