CodeIgniter Forums
Loading Models Within Core System Classes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Loading Models Within Core System Classes (/thread-48186.html)



Loading Models Within Core System Classes - El Forum - 01-07-2012

[eluser]Unknown[/eluser]
Hello,

I believe I may have discovered a bug in 2.1.0

When I attempt to load a model from within application/MY_Controller.php - whether within the constructor or within the method, I get an error.

The Error (Loading From Constructor):

Fatal error: Call to a member function model() on a non-object in C:\wamp\www\ult\application\core\MY_Controller.php on line 8

The same code works in earlier versions.

Please let me know if this is a bug.

Thanks