Passing URI Segments to your methods
If your URI contains more than two segments they will be passed to your method as parameters.
For example, let’s say you have a URI like this:
example.com/index.php/products/shoes/sandals/123
Your method will be passed URI segments 3 and 4 (“sandals” and “123”):
<?php
class Products extends CI_Controller {
public function shoes($sandals, $id)
{
echo $sandals;
echo $id;
}
}
Important!!!
If you are using the URI Routing feature, the segments passed to your method will be the re-routed ones.
Refer to this link as Codeigniter Official Guide.
Codeigniter Official Guide.