Question

I want to specify the routing rule for URL /responder/1/type/2/category/3/..., that in controller i could get string /responder/1/type/2/category/3/... and cut this string:

[0] = responder;
[1] = 1;
[2] = type;
[3] = 2;

and .etc. The amount of URL settings can be infinite

Was it helpful?

Solution

It sounds like you're looking for the URI class: http://ellislab.com/codeigniter/user-guide/libraries/uri.html

You can get the URL segments as an array by calling the segment_array() method in your controller:

//get the URI segments
$segments = $this->uri->segment_array();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top