Welcome Guest, Not a member yet? Register   Sign In
Model Name With underscore cannot loaded in production environment
#1

Hello everyone!
i was using CI ver.  2.2.0 for my ongoing projects and now I'm trying to switch to CI 3

The switching process was done successfully in my local environment(XAMPP) and i haven't found any error, but when i upload my project to production, i get an model not found error. "Unable to locate the model you have specified: Model_name ".

The thing is, when i try to load model which name containing underscore(_) CI always show model not found error. When i remove the underscore, CI runs perfectly. I'm not sure this is a bug since it does running fine in my local XAMPP and i have all the controller and model name changed to CI 3 standard.

What can i do to fix this problem ?
Reply
#2

Try to name it Model_Name
Reply
#3

@gadelat:
I have tried that too, but the error still show up
Reply
#4

Well, so you will need to debug it yourself then. Echo out path framework unsuccessfully tried to load in system/core/Loader.php on line 299 (e.g. by addin echo $mod_path.'models/'.$path.$model.'.php'; ).
Reply
#5

I don't see how the underscore in particular is the cause for any issue, it's case-sensitivity. Your class names must start with a capital letter, and the rest of them must be in lowercase.

(04-18-2015, 02:41 AM)gadelat Wrote: Try to name it Model_Name

That won't work, it must be 'Model_name' instead.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB