[eluser]Colin Williams[/eluser]
Quote:If you only use this everywhere you are redirecting to another method within the same controller
Another method in the same controller? Um, why not just call $this->other_method(), and exit if needed? I do this all the time.
Code:
class User extends Controller {
function User()
{
parent::Controller();
$this->load->library('users');
}
function index()
{
if ($this->users->check_access())
{
$this->dashboard();
}
else
{
$this->login();
}
}
function logout()
{
$this->users->logout();
$this->index();
}
}