CodeIgniter Forums
Unable to locate the model - 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: Unable to locate the model (/showthread.php?tid=4625)



Unable to locate the model - El Forum - 12-06-2007

[eluser]A.M.F[/eluser]
so... before i'll start i just want to say: i searched for an answer in the forum, but the answers i found didn't help me.

i have a user model name user_model.php in my application/models folst that looks like that:

Code:
class User extends Model
{
    function User()
    {
        // Call the Model constructor
        parent::Model();
    }

    function register()
    {
        return "dsfs";
    }

}

and i load my model like that:
Code:
$this->load->model('user');

but i keep getting the same error:
Quote:An Error Was Encountered
Unable to locate the model you have specified: user

why? my model file name isn't capitilazed and it is inside the correct folder.
my god i am lost...


Unable to locate the model - El Forum - 12-06-2007

[eluser]gtech[/eluser]
user_model.php, hummm I think your filename should be called user.php to match your model class name?


Unable to locate the model - El Forum - 12-06-2007

[eluser]A.M.F[/eluser]
omg i broke my head for about a half an hour and u saved me right now just with this little line. thank u!!


Unable to locate the model - El Forum - 12-06-2007

[eluser]gtech[/eluser]
lol, no probs sometimes the simplist of errors can be the biggest time wasters.


Unable to locate the model - El Forum - 12-10-2007

[eluser]Unknown[/eluser]
+1

I'm returning to CI for this project after spending time with RoR.
So I spent 10 min+ with this same problem

dont you just love having a community ?