title: how to call a function in another controller in code igniter?
body: <p>I want to call a function in another controller. for example if user try to log in with incorrect parameter then the application will redirect to another controller and passing a variable (array).</p>
  
  <pre><code>class User extends Controller {
  
  function User()
  {
     parent::Controller();
  }
  
  function doLogin()
  {
    $userData = $this-&gt;users-&gt;getAuthUserData($user,$password);
    if(empty($userData)){ 
     // this is where i need to call a function from another controller
    }else{
     echo 'logged in';
    }
  }
  
  }
  </code></pre>
  
  <p>is it possible passing a variable using redirect() function in url helper?</p>