those. would you advise me to use one controller method as follows:
function save() { if(!is_bool($this->input->post(''))) { $post_data = $this->input->post(''); $this->mymodel->save($post_data); } $this->load->view('myview'); }
Or could you write it using two methods?
function save() { if(!is_bool($this->input->post(''))) { $post_data = $this->input->post(''); $this->mymodel->save($post_data); } redirect('controller/method2') }
A redirect is a crucial difference. It prohibits the resubmission of updates, for example.
How do you do this? Is there any better way?
source share