title: getting error in codeigniter
body: <p>i'm autoloading a library named as 'render' in my codeigniter app.
  the full code of the library is :</p>
  
  <pre>
  class Render extends CI_Controller {
      public function template($template, $view, $extra_css, $extra_js) {
          $data = array();
          if (isset($view)) {
              $data['view'] = $view;
          }
          if (isset($extra_css)) {
              $data['extra_css'] = $extra_css;
          }
          if (isset($extra_js)) {
              $data['extra_js'] = $extra_js;
          }
          $template = $this->load->view("templates/$template", $data, TRUE);
          echo $template;
      }
  
  }
  </pre>
  
  <p>this library working fine but the problem is that whenever i load this library manually or by editing autoload file, i get an error when i load any model in any of my controller.</p>
  
  <pre>
  A PHP Error was encountered
  
  Severity: Notice
  
  Message: Undefined property: Home::$my_model_name
  
  Filename: controllers/home.php
  
  Line Number: 11
  </pre>
  
  <p>here line number 10 and 11 are :</p>
  
  <pre>
  $this->load->model('my_model_name');
  $this->my_model_name->my_model_method();
  </pre>
  
  <p>and i also tried to use :</p>
  
  <pre>
  $this->load->model('my_model_name', 'My_model');
  $this->My_model->my_model_method();
  </pre>
  
  <p>My controller "home" code is :</p>
  
  <pre>
  class Home extends CI_Controller {
      function __construct() {
          parent::__construct();
      }
      public function index()
      {
          $this->load->model('my_model_name');
          $this->my_model_name->index();
      }
  }
  </pre>
  
  <p>i tried to add a __construct() method to my library but still no luck.</p>