title: Can not load url helper in codeigniter
body: <p>I tried to load <code>base_url()</code> in controller, but codeigniter does not load the <code>helper('url')</code>. I also call helper from <code>autoload</code> and the constructor both in the hook, but it's still not working and showing an error "Trying to get property of non-object".</p>
  
  <p>Any idea how can I redirect?</p>
  
  <p>My code:</p>
  
  <pre><code>if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
  
  class Auth_hook {
  
      protected $CI;
  
      public function __construct() {
          $this-&gt;CI =&amp; get_instance();
          $this-&gt;CI-&gt;load-&gt;helper('url');
      }
  
      public function index(){
        redirect(base_url('auth/login'));
  
        print_r("hello!!");
        if(isset($_SESSION['name']) == 'TRUE'){
          redirect(base_url('auth/admin'));
        }
        else {
          redirect(base_url('auth/login'));
        }
      }
  }
  </code></pre>