Fatal error: Class 'Test_model' not found... |
[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.
[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.
[eluser]Gary the Llama[/eluser]
Yeah, I've tried that too. No luck. Same error.
[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
[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
[eluser]Gary the Llama[/eluser]
Well, I'm just retarded. I hadn't put my start (<?php) and end (?> tags in my model file. I'm sure it's a classic newbie mistake.
[eluser]nirbhab[/eluser]
:-) some times it happens with senior members also...not a great issue... |
Welcome Guest, Not a member yet? Register Sign In |