title: Loading a controller from another module in CodeIgniter HMVC
body: <p>I have two modules setup in CodeIgniter HMVC . One is templates and another is test . </p>
  
  <p>here is the folder structure ..</p>
  
  <ol>
  <li>templates
  <ul>
  <li>controllers
  <ul>
  <li>home.php</li>
  </ul></li>
  <li>-----
  <ul>
  <li>----.php</li>
  </ul></li>
  <li>views
  <ul>
  <li>layout
  <ul>
  <li>admin.php</li>
  <li>main.php</li>
  <li>user.php </li>
  </ul></li>
  </ul></li>
  <li>home.php </li>
  </ul></li>
  <li>test
  <ul>
  <li>controllers
  <ul>
  <li>test.php</li>
  </ul></li>
  </ul></li>
  </ol>
  
  <p>I have added a route variable in routes.php which routes home.php as the default controller for templates. and auto loaded template library .</p>
  
  <p>Now when i access <a href="http://mysite.com/templates/home/index" rel="nofollow">http://mysite.com/templates/home/index</a> or <a href="http://mysite.com/templates/" rel="nofollow">http://mysite.com/templates/</a> .. it works fine but when i run another module ( test ) it shows error . I have also tried <code>echo Modules::run('templates/home/index');</code> but same problem . I have the flowing codes in test.php</p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Test extends MX_Controller {
  
  
      public function index()
      {
         $this-&gt;load-&gt;module('templates');
         $this-&gt;templates-&gt;index();
  
      }
  }
  </code></pre>
  
  <p>it says <code>Unable to load the requested file: home.php</code></p>
  
  <p>here is my template library</p>
  
  <pre><code>&lt;?php
  
  if (!defined('BASEPATH'))
      exit('No direct script access allowed');
  
  class Template {
  
      private $template_data = array();
      private $headers = array();
      private $CI;
  
      public function __construct() {
          $this-&gt;CI =&amp; get_instance();
          $this-&gt;CI-&gt;config-&gt;load('template');
      }
  
      function set($name, $value) {
          $this-&gt;template_data[$name] = $value;
      }
  
      function add_header($header) {
          array_push($this-&gt;headers, $header);
      }
  
      function load($template = '', $view = '', $view_data = array(), $return = FALSE) {
          $this-&gt;CI = &amp; get_instance();
          $this-&gt;set('contents', $this-&gt;CI-&gt;load-&gt;view($view, $view_data, TRUE));
          $this-&gt;set('headers', implode('', $this-&gt;headers));
          return $this-&gt;CI-&gt;load-&gt;view($template, $this-&gt;template_data, $return);
      }
  
  }
  
  /* End of file Template.php */
  /* Location: ./system/application/libraries/Template.php */
  </code></pre>