![]() |
access to subFolder from subFolder - 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: access to subFolder from subFolder (/showthread.php?tid=35564) |
access to subFolder from subFolder - El Forum - 11-03-2010 [eluser]Mutsop[/eluser] Hi, I'm new to codeigniter and am quite excited to start my first application ![]() But as every rookie in this world, there are always "Brain hurters". So.... As stated in this title: I'm trying to access a view in a subfolder from a controller thats also set in a subfolder. Example: Controller: admin/login.php View: admin/login.php So in the controller I set Code: $this->load->view('admin/login', $data); But I do get a 404 page. When my controller is in the root of the controller folder it does work but not from a subfolder. I also tried: Code: $this->load->view('../admin/login', $data); But no use Any help? Kind regards Muts (not real name :p) access to subFolder from subFolder - El Forum - 11-03-2010 [eluser]danmontgomery[/eluser] Views belong in application/views, not in the controllers folder... Code: /application Then, Code: $this->load->view('admin/login', $data); access to subFolder from subFolder - El Forum - 11-03-2010 [eluser]techgnome[/eluser] The location of the view, is fine... how you are loading it (using "admin/login") is fine... what maybe causing the problem is how you are accessing your controller.... which should be : yoursitehere.com/admin/login the 404 isn't because of the view... the 404 happens because it can't find the controller... According to the User Guide, all you should need to do is include the subfolder name when calling the controller... -tg access to subFolder from subFolder - El Forum - 11-03-2010 [eluser]Mutsop[/eluser] Well these are the two files I have: application/controllers/admin/login.php Code: <?php application/views/admin/login.php Code: <!DOCTYPE html> So the placement should be good... access to subFolder from subFolder - El Forum - 11-03-2010 [eluser]Bart Mebane[/eluser] Your controller filename has to match the class name. access to subFolder from subFolder - El Forum - 11-03-2010 [eluser]Mutsop[/eluser] Sigh................... I should stop writing several pages at once ![]() Thanks alot |