![]() |
Modular Extension, HMVC, loading view files - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Modular Extension, HMVC, loading view files (/showthread.php?tid=39159) |
Modular Extension, HMVC, loading view files - El Forum - 03-02-2011 [eluser]ScreenName1[/eluser] Hi, In (H)MVC extension, everything works fine except I am having some problem with $this->load->view(); Assume that there is a main index.php file in ./application/views/ folder How can I load that view file within the modular controller? (for example, from ./application/modules/account/controllers/main.php where main.php is a controller) If I just type $this->load->view('index'); it only searches for index file with in ./application/modules/account/views/index.php, and not in top application/views/ folder The weird thing is that if I type type $this->load->view('index'); inside modular view files, not in modular controllers, it does search for view files in ./application/views/ directory. What is a good way to load a view file that is in ./application/views/ directory from a modular controller? Modular Extension, HMVC, loading view files - El Forum - 03-02-2011 [eluser]ScreenName1[/eluser] I used Code: $this->load->view('../../views/index'); to load index.php view file that is located in application/views/ directiory. ![]() |