title: Changing Themes In Codeigniter
body: <p>Iam deveolping a site with adddition fetaure chening the themes of user side.For this i created a library .I wrote  a function in that library to load header.php page.</p>
  
  <p>This is my library code:</p>
  
  <pre><code>&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
      class CI_theme_lib {
          public $theme_dir       = "themes/winter";
          public $header_page     = "header.php";
  
          public function get_header($header = ""){
              $dir = $this-&gt;theme_dir;
              $hdr = $this-&gt;header_page;
              $this-&gt;CI =&amp; get_instance();
              $string = $this-&gt;CI-&gt;load-&gt;view($dir.'/'.$hdr, '', true);
              return $string;
  
          }
  
      }
  ?&gt;
  </code></pre>
  
  <p>In themes/winter is the my theme folder i want to apply.And i craeted a controller to view the theme:
  Controller code:</p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  class test extends CI_Controller {
  
      public  function  __construct() {
  
          parent::__construct();
          $this-&gt;load-&gt;library(array('theme_lib'));
      }
      public function index()
      {
  
          $this-&gt;load-&gt;view('themes/winter/index');
      }
      }
  ?&gt;
  </code></pre>
  
  <p>And in themes/winter/index.php code:</p>
  
  <pre><code>&lt;?php
      echo $res = $this-&gt;theme_lib-&gt;get_header();
  ?&gt;
  </code></pre>
  
  <p>In header.php :</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;title&lt;/title&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>So when i used this code i got an error message:</p>
  
  <pre><code>An Error Was Encountered
  
  Unable to load the requested file: themes/winter/header.php
  </code></pre>
  
  <p>The <code>themes</code> in the root folder.
  So how can i load a view page from root folder directory not from view directory?</p>