Welcome Guest, Not a member yet? Register   Sign In
How to display update/delete confirmation message on View?
#1

[eluser]cidevelopment[/eluser]
Hello Community,
How can we display update or delete success message on view after successful update/delete action.
What I've done so far. I simply used following approach .

Code:
public function edit(){
  
  
  $reference = $this->uri->segment(4);
                
  // validation rules
  
  $this->form_validation->set_rules('name', 'Name', 'required');
  $this->form_validation->set_rules('membership', 'Status', 'required');
  
  

  if ($this->form_validation->run() === FALSE)
  {
  
   $this->load->model('roomtype_model');
   $data['query']= $this->roomtype_model->get_by_id($reference);
   $this->load->view('admin/editroomtype',$data);
  
  }
  else
  {
  
   $this->roomtype_model->update($reference);
   redirect('admin/roomtype/index/s');
  }
}

It redirects to :
http://localhost/example/index.php/admin...pe/index/s

is there any alternative rather to redirect to /index/s because in this way user can directly paste the link and view shall display the relative message. I do not want to pass params in url.
#2

[eluser]CroNiX[/eluser]
Flashdata from the Session Library.




Theme © iAndrew 2016 - Forum software by © MyBB