Home
> Uncategorized > CodeIgniter Unable to locate the model you have specified:
CodeIgniter Unable to locate the model you have specified:
In fact the problem is that code igniter does not deal with file name correctly.
If you use a filename in capital letter CI process it and convert the file name in lowercase. Thats why if you refer Mymodel.php instead of “MyModel.php” it will search “mymodel.php”. It results the file as unavailable.
like if you have this line in your controller and have a file named “Model_test.php” in models folder the file will not be accesable.
$this->load->model(‘Model_test’);
So, the file should be renamed as “model_test.php”
Hope it will work π
NO, this is not the case.
I have saved the model name HelloModel.php
and have the following code in controller but it works fine.
$this->load->model(‘HelloModel’);
$this->HelloModel->selectData();
Thanks Arup for the reply.
But actually you are wrong.
This is the way CI handles URL.
YOu can check CodeIgniter.php or Router.php and some other related file to be sure of it.
π
I like the post. This is same problem I faced before. And solved with the same way, as you described.
YES! Thanks SO FRIGGIN’ MUCH!
Strange issue, really. It works locally here on my machine but once I pushed the live copy up to my dev server the load->model call wouldn’t work. I changed the first character case top lowercase and voila!
Thanks again.
Thanks, so dumb of me, i didnt see the issue, linux and ms treat the filenames differently.
I sure need to setup my home local web server..
thanks again for your tip!
thanks but , still dont work π¦
have u got other advice ?
sometimes “Unable to locate the model you have specified:” when the file is missing.
thank you
it works for me
Thank you! you saved me at least a couple of hours of banging my head against a wall!!
Gracias!!! AhΓ estaba el problema
sii… maldito camelcase
it’s really save my lot much time… I was trying it more than 2 hours…..
Thanks
thanks.. its very helpfull
problem solved thanks thanks.. !!
I have faced below error my application how to solve this problem i have followed user guide “news section ” when i run new it is showing below error could you please give me solution
“Unable to locate the model you have specified: news_model”
Thank u sooo much, it works π
problem solves
i am really grateful to you……
thank you very much
I have not understood how the problem was solved
yes… its working buddy… thanks lot…
u saved my time.. π
can you help me, I was create website with modx I install to may computer , but when I move the file to New server, trouble : this error I found :
“An Error Was Encountered
Unable to locate the model you have specified: db_model”
thanq so much.
THANKSSSS BROHTTTTT LOWCASE WORKS
Thanks π
I think if you are working with Windows then you are fine, no need to rename your model name,
BUT under Linux you need to do that π¦