Welcome Guest, Not a member yet? Register   Sign In
routes bug ?
#1

[eluser]EugeneS[/eluser]
in routes.php i have:
Code:
$route['contacts'] = 'welcome/index/2';

then i go to the url like:
http://localhost/contacts

yes i'm in the class "welcome" method "index" but when i'm trying to access url segments it doesnt work:
Code:
echo $page_id = $this->uri->segment(1, 1);
result: contacts

echo $page_id = $this->uri->segment(2, 1);
result: 1

echo $page_id = $this->uri->segment(3, 1);
result: 1

i was thinking it should be
Code:
echo $page_id = $this->uri->segment(1, 1);
result: welcome

echo $page_id = $this->uri->segment(2, 1);
result: index

echo $page_id = $this->uri->segment(3, 1);
result: 2

my expectations are wrong or its bug ?
#2

[eluser]frenzal[/eluser]
if you want the rerouted segments use uri->rsegment
#3

[eluser]EugeneS[/eluser]
[quote author="frenzal" date="1206335661"]if you want the rerouted segments use uri->rsegment[/quote]


ouch ! Smile thanks ... its time to get some rest Smile




Theme © iAndrew 2016 - Forum software by © MyBB