Welcome Guest, Not a member yet? Register   Sign In
best practice with form,validation,error,success,action order
#2

[eluser]BravoAlpha[/eluser]
I do something like this:
Code:
function whatever()
{
    // whatever

    if ($this->validation->run())
    {
        // process the validated input (e.g. database stuff)
        // redirect
    }

    // load view
}

However, you could also follow the example in the user guide:
Code:
function index()
{
    $this->load->library('validation');

    if ($this->validation->run() == FALSE)
    {
        $this->load->view('myform');
    }
    else
    {
        $this->load->view('formsuccess');
    }
}


Messages In This Thread
best practice with form,validation,error,success,action order - by El Forum - 08-20-2007, 09:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB