title: codeigniter - using helper in controller doesn't work
body: <p>I need to use a function in multiple controllers.
  So I though about using a custom helper, but it seems I can't get it to work. (It works in the view, but I need it in the controller)</p>
  
  <p>It gives me following Fatal Error:</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined method Developers::checkIfLoggedIn() in
    /application/controllers/developers.php on line 12</p>
  </blockquote>
  
  <p>Is it a smart move to use a helper to use a function in multiple controllers, or should I do it otherwise.</p>
  
  <p>Thanks in Advance,<br>
  Mark</p>
  
  <p><strong>EDIT:</strong><br>
  Controller file: </p>
  
  <pre><code>if (!defined('BASEPATH')) exit('No direct script access allowed');
  
  class Developers extends CI_Controller
  {
      public function __construct()
      {
           parent::__construct()
           $this-&gt;load-&gt;helper('form');
           $this-&gt;load-&gt;helper('url');
           $this-&gt;load-&gt;helper('login');
  
           //helper function
           checkIfLoggedIn($this-&gt;session-&gt;userdata('loggedIn'));
      }
  }
  </code></pre>
  
  <p>Helper file:  </p>
  
  <pre><code>if (!defined('BASEPATH')) exit('No direct script access allowed');
  
  if (!function_exists('checkIfLoggedIn'))
  {
      function checkIfLoggedIn($session_loggedIn)
      {
          $loggedIn = $session_loggedIn;
          if($loggedIn == false)
          {
              redirect('login/');
          }
      }
  }
  </code></pre>
  
  <p>}</p>