So, in the controller you can have one function:
$in=1; redirect(base_url()."home/index/".$in);
And in the objective function, you can access the value of $ in as follows:
$in = $this->uri->segment(3); if(!is_numeric($in)) { redirect(); }else{ if($in == 1){ } }
I put segment (3) because in your example $ in is after two dashes. But if you have, for example, this link structure: www.mydomain.com/subdomain/home/index/$in , you will need to use segment (4) .
Hope this helps.
source share