Welcome Guest, Not a member yet? Register   Sign In
Multiple views from one controller
#1

[eluser]satterle[/eluser]
I think I figured it out on my own!

1. the view statement should be view('delete'), not view('co/delete')
2. going to a different mvc, in this case 'cancel', requires redirect('co/cancel')

------------------------

I have a controller that deletes a record from a database. I set it up as follows:

if($this->input->post('delete'))
{
$this->model->delete($id)
$this->load->view('co/delete', $data)
}
else if($this->input->post('cancel'))
{
$this->load->view('co/cancel', $data)
}
else
{
$this->load->view('co/delete', $data)
}

When I load the page the first time (the else condition), no problem.
When I try to load the page from the if conditions, I get an error message "unable to load the requested file: name of file".

I know that the if statements are working because a) a record is deleted when I click the delete button and b) the error message displays the appropriate file name when I click on the different buttons on the form.

Why don't the views load? How do I correct?


Messages In This Thread
Multiple views from one controller - by El Forum - 06-23-2008, 01:17 PM
Multiple views from one controller - by El Forum - 06-23-2008, 06:38 PM
Multiple views from one controller - by El Forum - 06-23-2008, 08:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB