title: CodeIgniter load lang-file in extended controller
body: <p>I have extended my CI_Controller like this:</p>
  
  <pre><code>// base extend
  class MY_Controller extends CI_Controller {
        public $CI = array();
  
        public function __construct() {
          parent::__construct();
          $this-&gt;CI = &amp; get_instance();
        }
        public function isUser(){
        // for example
        }
  }
  
  // admin extended
  class MY_AdminController extends MY_Controller {
  
       public $admin = array();
  
       public function __construct() {
  
          parent::__construct();
  
          $this-&gt;CI-&gt;lang-&gt;load('admin');
  
          $this-&gt;admin['lang'] = $this-&gt;CI-&gt;lang-&gt;line('admin');
  
          $this-&gt;CI-&gt;load-&gt;vars($this-&gt;admin);
  
       }
  
  
       public function isAdmin(){
       //for example
       }
  }
  
  // extends for modules
  class MY_AdminModuleController extends MY_AdminController {
       public function __construct() {
          parent::__construct();
          $this-&gt;CI-&gt;load-&gt;view('_header');
       }
       public function isAllowedModule(){
       // example
       }
       public function pseudoDestruct(){
          $this-&gt;CI-&gt;load-&gt;view('_footer');
       }
  }
  </code></pre>
  
  <p>So it works fine. But I try to hook <code>post_controller</code>event and add my <code>MY_AdminModuleController-&gt;pseudoDestruct()</code>, so I enabled hooks in config.php and added next lines to hooks:</p>
  
  <pre><code>$hook['post_controller'] = array(
      'class' =&gt; 'MY_AdminModuleController',
      'function' =&gt; 'pseudoDestruct',
      'filename' =&gt; 'MY_Controller.php',
      'filepath' =&gt; 'core'
  );
  </code></pre>
  
  <p>But I got a problem at loading lang-file in MY_AdminController's constructor. It returns <code>null</code> when called from hook (<code>true</code> when I use it normaly) and I have Notice about undefined index at frontend. No, I don't want to disable notices, I want to fix the problem. Also I have config loadings in MY_AdminController's constructor and them loading good.</p>