Re-Direct vs Load View - Help Please! |
[eluser]Hayezb[/eluser]
Hello! I'm fairly new to CodeIgniter and I'm having some issues with re-direct vs loading my view when a form is submitted successfully and/or unsuccessfully. I want to use view, because with re-direct I'm having to put all my validation errors and POST data in sessions which is very annoying. Here's a break down of the user process... 1.) User selects a company from a data table. 2.) User chooses to Add Location for this company and the form opens up with following URL: http://virtue-dev/administration/vendors/add_vendor_location/2 How do I load this view without having to do a re-direct? Will not work: Code: $this->load->view('administration/header'); I get the following error: Code: Unable to load the requested file: administration/add_vendor_location/2.php
[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() I'm just off to bed so may have misunderstood your question but I hope this helps |
Welcome Guest, Not a member yet? Register Sign In |