CodeIgniter Forums
MY_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: MY_Model not found (/showthread.php?tid=54113)



MY_Model not found - El Forum - 08-23-2012

[eluser]jahsen[/eluser]
i moved my site from windows machine to cent os
and i have an error "Unable to locate the model you have specified: my_model"
MY_Model.php is in application/models, . i tried to put it in application/core but still the same..


MY_Model not found - El Forum - 08-23-2012

[eluser]marcogmonteiro[/eluser]
your my_model file should stay in your application/core folder. But that sounds to me like a case sensitive problem. Check the name of your files and all that to see if you didn't make any mistakes.


MY_Model not found - El Forum - 08-23-2012

[eluser]NeoArc[/eluser]
Name of your file: /core/MY_Model.php
Name of your class: MY_Model


MY_Model not found - El Forum - 08-23-2012

[eluser]jahsen[/eluser]
When i do this it is not working on both machines..
I get the same error.


MY_Model not found - El Forum - 08-23-2012

[eluser]NeoArc[/eluser]
Which version of CI are you using right now?


MY_Model not found - El Forum - 08-23-2012

[eluser]jahsen[/eluser]
2.1.1


MY_Model not found - El Forum - 08-23-2012

[eluser]jahsen[/eluser]
Found It!
I removed it from the autoload.php Smile


MY_Model not found - El Forum - 08-23-2012

[eluser]NeoArc[/eluser]
You are saying that you renamed your class from "my_model" to "MY_Model" and now it is not working, also, the file name stayed the same, is that so?

add a echo 'test'; before the class declaration to check the file is loaded.

edit:
Ok, nice.


MY_Model not found - El Forum - 08-23-2012

[eluser]jahsen[/eluser]
Everything was ok but was in the /models directory
and i removed it from the autoload


MY_Model not found - El Forum - 08-23-2012

[eluser]CroNiX[/eluser]
Whenever you extend CI with MY_, you still just load the original parent and CI will autoload MY_whatever if it exists.