Welcome Guest, Not a member yet? Register   Sign In
Modular Extension, HMVC, loading view files
#1

[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?
#2

[eluser]ScreenName1[/eluser]
I used

Code:
$this->load->view('../../views/index');

to load index.php view file that is located in application/views/ directiory. Smile




Theme © iAndrew 2016 - Forum software by © MyBB