Welcome Guest, Not a member yet? Register   Sign In
Uri re-routing doesn't work
#1

[eluser]frietkot[/eluser]
Hi,

i figured that with uri routing you can use something like this:
www.example.com/user/$variable_user

and that works.

But now I have something like this:
www.example.com/$variablecity/news

and I have this in the routes.php file:
$route[':any/news'] = "news/city";

and that works too.
But here's the thing...

When I use the uri class and use $this->uri->segment(); or $this->uri->rsegment();
it returns nothing when I want to know the first segement (the city name in this case).

Any suggestions?
#2

[eluser]xwero[/eluser]
You need to add the city name to the rerouted segments. For example like this
Code:
$route[’(:any)/news’] = “news/city/$1”;
Now the city name is the first parameter of the city method.
#3

[eluser]frietkot[/eluser]
Thanks,

That did the trick




Theme © iAndrew 2016 - Forum software by © MyBB