[eluser]sunpietro[/eluser]
Hi,
I'm new to the CodeIgniter and I have problem with $this->uri->segment(...).
My controller function looks like this:
Code:
function editDrink() {
$id = $this->uri->segment(3);
$query = 'SELECT * FROM skladniki';
$data['header'] = $this->header();
$data['ingred'] = $this->ManagerModel->getFromDB($query);
if($this->input->post('submit')) {
$name = $this->input->post('name',TRUE);
$desc = $this->input->post('desc',TRUE);
$res = $this->ManagerModel->updateDrink($id,$name,$desc);
$this->index();
}
else {
$data['drink'] = $this->ManagerModel->getDrink($id);
$data['alert'] = '';
$data['id'] = $id;
$this->load->view('manager_editDrink',$data);
}
}
I'm trying to use this to redirect into editDrink view but I get 404 error. But am I doing wrong?