Model Not Loaded? |
[eluser]Vik[/eluser]
I've just started working with CI, I have a newbie question. I have a controller that contains this code: Code: <?php I have a file called "add_alloys_model.php" (well, it's actually not alloys, it's something else, but I'm not ready to announce it yet) in the models folder. But, it looks like it's not being loaded. The echo statements in the code print out 'a' and 'b', and then everything stops. The rendered html page is completely blank. What should I check in order to fix this?
[eluser]chobo[/eluser]
try this Code: $this->load->model('add_alloys_model', '' ,true);
[eluser]Vik[/eluser]
I tried the suggestion: Code: $this->load->model('add_alloys_model', '' ,true); I'm sure this is some sort of newbie error. Are there any other things I could check?
[eluser]Rick Jolly[/eluser]
If you are on windows this might not help, but model names should be capitalized.
[eluser]Michael Wales[/eluser]
models names are only capitalized within the code: Code: class Add_allows_model extends Model { Not when the model is called - that should always be lowercase, as is the filename.
[eluser]Michael Wales[/eluser]
In regards to the question - I'm sure it's a syntax error in your model. Blank pages are almost always PHP errors.
[eluser]fMertins[/eluser]
[quote author="walesmd" date="1186695237"]models names are only capitalized within the code: Code: class Add_allows_model extends Model { Not when the model is called - that should always be lowercase, as is the filename.[/quote] Hi! My app is working fine at localhost & Windows, but when trying to do the same in real hosting website using Linux, I got this error: An Error Was Encountered Unable to locate the model you have specified: clientemodel Please take a look this sshot, I stroked the important parts... I´m don´t understanding the problem... Even if I try call model with CamelCase sintax, doesn´t works... :-( And I´m a little bit ashmed with this "complex" problem... :-P :red: Thanks again
|
Welcome Guest, Not a member yet? Register Sign In |