Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading Model in Codeigniter 1.7.3

Hello and thanks for reading,

I have a problem, I have a controller "Articles" that is supposed to load Model called "Articles", only problem is I get a 500 server error when I try to load that model?

Any suggestions?

Thanks in advance,

H

like image 647
hypervisor666 Avatar asked Aug 10 '26 13:08

hypervisor666


1 Answers

I found the solution, it turns out that you cannot load a Model with the same name as the controller in which it is being called, it really confuses codeigniter.

My controller class name was "Articles" and my model name was "Articles". When I changed the model class name to "Articles_model" instead it worked fine. I just thought I would share this in case any one else has this problem too.

Regards,

H

like image 130
hypervisor666 Avatar answered Aug 13 '26 03:08

hypervisor666