title: CodeIgniter HMVC extends MX_Controller, unable to use get_instance properly
body: <p>I have a controller in /application/core</p>
  
  <p><strong>/application/core/CMS_Controller.php</strong></p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  require APPPATH."third_party/MX/Controller.php";
  
  class CMS_Controller extends MX_Controller {
  
      public function __construct() {
          parent::__construct();
      }
  
      public function show_something() {
          echo "something shown";
      }
  } 
  </code></pre>
  
  <p>I have another controller in a module (/modules/my_module/controllers/controller.php) which extended from CMS_Controller</p>
  
  <p><strong>/modules/my_module/controllers/controller.php</strong></p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Controller extends CMS_Controller {
  
      public function index() {
          $this-&gt;load-&gt;view('view');
      }
  } 
  </code></pre>
  
  <p>And, in view.php (/modules/my_module/views/view.php) I do this:
  <strong>/modules/my_module/views/view.php</strong></p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
   $ci =&amp; get_instance();
   echo $ci-&gt;show_something();
  ?&gt; 
  </code></pre>
  
  <p>And I get this error:</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined method CI::show_something() in
    /home/gofrendi/public_html/No-CMS/modules/my_module/views/view.php on
    line 3</p>
  </blockquote>
  
  <p>It will works if I don’t use MX_Controller and using CI_Controller instead:
  <strong>/application/core/CMS_Controller.php</strong></p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  //require APPPATH."third_party/MX/Controller.php";
  
  class CMS_Controller extends CI_Controller {
  
      public function __construct() {
          parent::__construct();
      }
  
      public function show_something() {
          echo "something shown";
      }
  } 
  </code></pre>
  
  <p>Anybody know what’s wrong here?</p>