0

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

1 Answer 1

1

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();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.