title: Codeigniter extends core class
body: <p>I want to have class that checks login on all controllers that I specified.
  Codeigniter version is 2.1.0 and I have php 5.3.10</p>
  
  <p>Hier is how I would set it up:
  I look at <a href="https://www.codeigniter.com/user_guide/general/core_classes.html" rel="nofollow noreferrer">https://www.codeigniter.com/user_guide/general/core_classes.html</a>
  and I set it up like this:
  in the /application/core/MY_Main.php</p>
  
  <pre><code>class MY_Main extends CI_Controller {
  
  function __construct()
  {
      parent::__construct();
  }
  }
  </code></pre>
  
  <p>In my controller I have welcome.php</p>
  
  <pre><code>?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Welcome extends MY_Main {
  
      function __construct()
      {
              parent::__construct();
      }
      public function index()
      {
              $this-&gt;load-&gt;view('welcome_message');
      }
  }
  </code></pre>
  
  <p>So if I place login check in MY-Main it should get work, but I cant get it work anyone???</p>