Welcome Guest, Not a member yet? Register   Sign In
Re-Direct vs Load View - Help Please!
#2

[eluser]Ckirk[/eluser]
You shouldn't have to worry about input and errors.
In short you should use $this->load->view() when you need to retain the input data and redirect() when you're done.
Something like this:

Code:
function theform()
{
  if ($this->form_validation->run() == TRUE)  // If no validation errors
  {
    // Insert code to handle form input
  
    // We no longer need the input data so redirect to start with a clean slate - especially if the page we're loading now is the form
    redirect('xxx/xxx');
  }

  // We'll only get here if form_validation is false
  $this->load->view('theFormView', $this->data);
}  /* End of function theform() */

I'm just off to bed so may have misunderstood your question but I hope this helps Smile


Messages In This Thread
Re-Direct vs Load View - Help Please! - by El Forum - 02-24-2014, 02:43 PM
Re-Direct vs Load View - Help Please! - by El Forum - 02-24-2014, 05:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB