[eluser]Buso[/eluser]
I only do the validation in the controller, the other stuff in the model, so I don't have to see it every time.
Also, if the TRUE or FALSE block is short enough, you can avoid using 'if' like this:
Code:
$this->form_validation->run() OR $this->login() // if validation fails, show the login again
// here keep trying to make the login fail
In this case, the FALSE block is only a function call. Then I can do that.
If it was the oposite case, you could change the condition to:
Code:
! $this->form_validation->run() OR redirect('success') // if validation passed, show the success page
or
Code:
$this->form_validation->run() AND redirect('success') // if validation passed, show the success page
or whatever fits the case