El Forum
08-08-2011, 03:23 PM
[eluser]OliverHR[/eluser]
I'm a little confused, why URI library never return subfolders name when using a route.
Let me show my problem, I definded this route:
Where:
"admin" is a subfolder in the controllers folder.
"products" is a controller
"detail" is a function who expects a numeric parameter
I must say that everything works fine, but if i try to use the next code:
Using the url "http://localhost/product/1" I get this:
And The subfolder?...
But, if I use the full url "http://localhost/admin/products/detail/1" I get:
Thank's in advance for any help.
I'm a little confused, why URI library never return subfolders name when using a route.
Let me show my problem, I definded this route:
Code:
$route['product/(:num)'] = 'admin/products/detail/$1';
Where:
"admin" is a subfolder in the controllers folder.
"products" is a controller
"detail" is a function who expects a numeric parameter
I must say that everything works fine, but if i try to use the next code:
Code:
function detail($id = 0)
{
echo '<pre>';
print_r($this->uri->segment_array());
print_r($this->uri->rsegment_array());
echo '</pre>';
}
Using the url "http://localhost/product/1" I get this:
Quote:Array
(
[1] => product
[2] => 1
)
Array
(
[1] => products
[2] => detail
[3] => 1
)
And The subfolder?...
But, if I use the full url "http://localhost/admin/products/detail/1" I get:
Quote:Array
(
[1] => admin
[2] => products
[3] => detail
[4] => 1
)
Array
(
[1] => products
[2] => detail
[3] => 1
)
Thank's in advance for any help.