[eluser]LifeSteala[/eluser]
Hi guys, small question.
Consider this code:
Code:
class Myclass extends MY_controller {
function Myclass {
// Do stuff here
// Display a view which contains a link:
// Link to /myclass/remove/value/
}
function remove() {
$val = $this->uri->segment(3);
if ( empty($val) ) {
redirect('/myclass/', 'location');
}
}
}
The main controller loads a default view:
/url/myclass/
which has a link to remove an item lets say. After I click the link it takes me to:
url/myclass/remove/3
From here, if a value is not present I want it to redirect to the default view
url/myclass/
How is this done? Currently it takes me to:
url/myclass/3/myclass
Thanks