CodeIgniter Forums
Autoloading model library - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Autoloading model library (/showthread.php?tid=5309)

Autoloading model library - El Forum - 01-16-2008

This is a weird one... I´m not sure why this happens, but in Loader class, lines 934 to 938 (svn version), I have

if (in_array('model', $autoload['libraries']))
                $autoload['libraries'] = array_diff($autoload['libraries'], array('model'));

The thing is that it seems to expect the model class in the library autoload, but if I actually pass it, it actually fails (Missing argument 1 for CI_Loader::model()), and if I have a model in the autoload['model'] array, It attempts to include model class twice. My advice is to remove model from the library array, or at least delete this lines that seems very useless...