Welcome Guest, Not a member yet? Register   Sign In
Model can’t load or use libraries or other models from the constructor
#2

[eluser]Colin Williams[/eluser]
That's because in a model class, $this references the current class, and all of those libraries and models are assigned to the controller class, which can be obtained with the get_instance() function.

CI does copy over some of the controllers references, but only when the model is loaded, not every time a library or other model is loaded. Think about two distinct objects, a Model and a Controller, and keep in mind who has what.


Messages In This Thread
Model can’t load or use libraries or other models from the constructor - by El Forum - 01-09-2010, 11:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB