CodeIgniter Forums
Problem loading a model within a model outside of the constructor - includes remedy. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem loading a model within a model outside of the constructor - includes remedy. (/showthread.php?tid=3977)



Problem loading a model within a model outside of the constructor - includes remedy. - El Forum - 10-31-2007

[eluser]MPress[/eluser]
Please read http://ellislab.com/forums/viewthread/63953/ for more info. Specifically:
[quote author="MPress" date="1193887618"]The problem is in the 'model' method of Loader.php.

You just have to add
Code:
$this->_ci_assign_to_models();
to the last line (after line 169) of the 'model' method and the problem disappears. Without this line, the reference to the newly instantiated model is not being assigned to the subject (calling) model and only exists in the CI instance.

I'll reference this thread in a bug report and hopefully this will be remedied in the next release.[/quote]