Welcome Guest, Not a member yet? Register   Sign In
URI Routing - ID Segment not being passed - use rsegment()
#1

[eluser]Mantishead[/eluser]
I imagine it's me doing something wrong, but if anybody can help it would be great.

I have the following rules in my routes.php file:

$route['me/first'] = "faq/category/1";
$route['me/second'] = "faq/category/2";
$route['me/third'] = "faq/category/3";

When I visit www.mysite.com/me/first I am correctly being routed to far/category, however, the 3rd segment, the ID is not being passed along as when I:

echo $this->uri->segment(3);

Nothing is there. If I echo segment 2, I get 'category' as expected.

Why is the 3rd segment not visible?
#2

[eluser]Mantishead[/eluser]
Found it in the URI class...

Need to use rsegment(3) to get the re-routed value...

echo $this->uri->rsegment(3);




Theme © iAndrew 2016 - Forum software by © MyBB