topbennie
topbennie

Reputation: 149

Loading views in codeigniter HMVC not working

I am trying to load a view from a second controller's view within my first controller but it gives the error that the view cannot be found, even though it is there.

Example
Module -> music
Views -> new -> file1.php
Views -> old -> file2.php

Controller -> new.php

From within the new.php I am using the function index() and trying to load the view

     $this->load->view('old/file2.php');

As you can see, I am trying to load the view file2(this is from another controller) from within the controller new but it does not want to display.

Upvotes: 3

Views: 6860

Answers (1)

Ross
Ross

Reputation: 17967

pretty sure you need to add the name of the module:

$this->load->view('music/old/file2');

should do it.

Upvotes: 11

Related Questions