title: Codeigniter view not letting me use subdirectory
body: <p><strong>Background</strong></p>
  
  <p>I am using this custom modification Codeigniter in order to allow me to use static header and footer. But since I started using it whenever I create a folder in my views folder and put my view file in there and try loading the view it doesn't pass the variables through to the view from the controller.</p>
  
  <p><strong>The Code</strong></p>
  
  <p><strong>The modification for static header and footer</strong></p>
  
  <pre><code>&lt;?php 
  
  class MY_Loader extends CI_Loader {
      public function template($template_name, $vars = array(), $return = FALSE) {
          if($return):
          $content  = $this-&gt;view('common/header', $vars, $return);
          $content .= $this-&gt;view($template_name, $vars, $return);
          $content .= $this-&gt;view('common/footer', $vars, $return);
  
          return $content;
      else:
          $this-&gt;view('common/header', $vars);
          $this-&gt;view($template_name, $vars);
          $this-&gt;view('common/footer', $vars);
      endif;
  
      }
  }
  </code></pre>
  
  <p>This works fine but only if I put my view file in the view folder itself, the second I put my view in a subfolder in the views folder the variables dont get passed through.</p>
  
  <p><strong>The Controller using my template function</strong></p>
  
  <pre><code>&lt;?php
  
  
  class Welcome extends CI_Controller {
  
      public function index()
      {
          $data['test'] = 'test';
          $this-&gt;load-&gt;template('sheets/welcome_message',$data);
      }
  }
  
  </code></pre>
  
  <p><strong>To sum up</strong></p>
  
  <p>If I put the view welcome_message.php in the views folder the variables get passed correctly. </p>
  
  <p>If i put the view in a subfolder in the main view folder the variables dont get passed through.</p>
  
  <p>Im not sure why this is happening, been wracking my brain but nothing obvious stands out. </p>