![]() |
Fatal error: Class 'Test_model' not found... - 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: Fatal error: Class 'Test_model' not found... (/showthread.php?tid=7093) |
Fatal error: Class 'Test_model' not found... - El Forum - 03-24-2008 [eluser]Gary the Llama[/eluser] Brand new to CI and I've been going through the User Guide. Everything was great until I got to the Models section. Here's my model code which is in application/models/test.php: Code: class test extends Model I call it from application/controllers/mytest.php like so: Code: function index() And when I go to the page I get this error: Fatal error: Class 'test' not found in /nfsn/content/garythellama/public/system/libraries/Loader.php on line 177 Any ideas? I saw that there were issues with the class names of your model so I've tried every possible variation and it hasn't made a difference. Fatal error: Class 'Test_model' not found... - El Forum - 03-24-2008 [eluser]Armchair Samurai[/eluser] Direct from the User Guide: Quote:Class names must have the first letter capitalized with the rest of the name lowercase.Depending on what system you're running, text might be case sensitive - try capitalizing your class name and constructor. Fatal error: Class 'Test_model' not found... - El Forum - 03-24-2008 [eluser]Gary the Llama[/eluser] Yeah, I've tried that too. No luck. Same error. Fatal error: Class 'Test_model' not found... - El Forum - 03-24-2008 [eluser]nirbhab[/eluser] Use <?php ?> rather than <? ?>, is there any directory or controller or library named test? I mean, is there any other class test in controller or owner library. finally, try this: Code: class testing extends Model Fatal error: Class 'Test_model' not found... - El Forum - 03-24-2008 [eluser]wiredesignz[/eluser] The error suggests the loader has found and loaded the test.php file, but it can't find the class. Code: //CI_Loader.php line 173 Fatal error: Class 'Test_model' not found... - El Forum - 03-25-2008 [eluser]Gary the Llama[/eluser] Well, I'm just retarded. I hadn't put my start (<?php) and end (?> ![]() ![]() Fatal error: Class 'Test_model' not found... - El Forum - 03-25-2008 [eluser]nirbhab[/eluser] :-) some times it happens with senior members also...not a great issue... |