Controllers not loading views |
[eluser]ssharp[/eluser]
I have three controllers in my app. Two of them will not load views and the other will. It's not an issue with the actual view files, because the controller that does work will load the views associated with the other two controllers. The two controllers that don't work will not load any view at all. Note that everything worked fine until I put the files on a new server. I think the config is okay but I'm not sure why CI is behaving this way. The the controllers that aren't working produce 404 Pages. Any ideas? This is driving me crazy!
[eluser]new developer[/eluser]
Did you check the .htaccess file..i am new as well
[eluser]hugle[/eluser]
[quote author="ssharp" date="1226533477"]I have three controllers in my app. Two of them will not load views and the other will. It's not an issue with the actual view files, because the controller that does work will load the views associated with the other two controllers. The two controllers that don't work will not load any view at all. Note that everything worked fine until I put the files on a new server. I think the config is okay but I'm not sure why CI is behaving this way. The the controllers that aren't working produce 404 Pages. Any ideas? This is driving me crazy![/quote] give the path name, controled file name (.php) and the source of the controleer witch is not working. also the view file would be welcome.
[eluser]ssharp[/eluser]
Here is the .htaccess Code: RewriteEngine on The controllers names are: equipment, cart, and admin. Admin works, the other two don't. The views are all in subfolders called equipmnet/, cart/ and admin/. As a note, I tried loading views from cart/ in the admin controller and it worked. I also tried loading admin/ views in the controllers that weren't loading views and this didn't work.
[eluser]ssharp[/eluser]
Here is a controller that works. Code: class Admin extends Controller { www.mysite.com/admin/index works www.mysite.com/admin/loadotherview works Here is a controller that doesn't work: Code: class Cart extends Controller { www.mysite.com/cart/view doesn't work www.mysite.com/cart/test does work The cart/view function works fine. If I did a print_r($viewData) and die(); right before the $this->load->view, it would output the $viewData just fine. It's failing when it loads the view.
[eluser]Colin Williams[/eluser]
view() is a reserved method if you are running PHP 4. Might be causing issues..
[eluser]orotone[/eluser]
Are you developing on windows and uploading to a Linux/Unix server? If so, case on your file names matters in the Linux/Unix world and doesn't in the windows world. OT
[eluser]ssharp[/eluser]
Thanks for the help, they were all PHP4 issues. Didn't even think of that as I haven't used a server running PHP4 in several years. I just had to change some names around...I was developing on OSX, so the file names weren't the problem just some restricted words. |
Welcome Guest, Not a member yet? Register Sign In |