3

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.

topbennie
  • 149
  • 2
  • 3
  • 5
  • `.php` on your view call is unnecessary... check manually and confirm that your view is in `system/application/views/old/file2.php` – jondavidjohn Jan 12 '11 at 02:19
  • Thanks for the reply, I am using the HMVC so the file is located in system/application/modules/music/views/old/ – topbennie Jan 12 '11 at 02:41

1 Answers1

11

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

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

should do it.

Ross
  • 18,117
  • 7
  • 44
  • 64