loading model error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: loading model error (/showthread.php?tid=39079) |
loading model error - El Forum - 02-28-2011 [eluser]mikeme[/eluser] Hello, When I try to load my model (either through autoload.php or in controller) I get the following symptoms: - my browser window shows my model class definition - the apache error log shows: PHP Fatal error: Class 'Page_model' not found in /Library/WebServer/Documents/system/core/Loader.php on line 198 I've tried renaming application/models/Page_model.php to have both upper and lower case first letter. I've also tried upper and lower case first letter in model name in the line that does the loading: $this->load->model('Page_model'); Any ideas on what is causing this? Thanks. loading model error - El Forum - 03-01-2011 [eluser]InsiteFX[/eluser] The file name should be all lowercase! Only the class name has the first char uppercase. InsiteFX loading model error - El Forum - 03-01-2011 [eluser]mikeme[/eluser] Yes, tried both upper and lower case for file name (I left the class name with an upper case first letter). I still get this error in the apache logs and for some reason the actual definition of the model class (just as I typed it) gets shown in the browser window. Possibly a PHP on Mac OS configuration issue? loading model error - El Forum - 03-01-2011 [eluser]mikeme[/eluser] Well, that was dumb. I had somehow missed the fact that I had left the php tags off the file holding the class... Of course, PHP threw an error saying the class wasn't found. Too much cutting and pasting, I think.. |