[eluser]Maarten Troonbeeckx[/eluser]
You guys,
I'm trying to parse the following URLs:
Code:
http://my.shop.be/browse/electronics/hifi
http://my.shop.be/browse/electronics/hifi/00020/sony-bravia
The first one shows all products in subcategory
hifi (parent category is
electronics).
The second one show the product
Sony Bravia with productID = 20.
My
routes look like this (RegExhibit to the rescue

):
Code:
$route['browse/([a-zA-Z0_9\/]+)'] = 'browse/category/$1';
$route['browse/([a-zA-Z0_9\/]+)/([0-9]+)/[a-zA-Z0-9]+'] = 'browse/product/$2/$1';
My
browse controller is setup like this:
Code:
function category($path);
function product($productID, $path)
Problem is that, instead of one parameter $path which equals 'electronics/hifi' in the both functions, it is passed as two parameters, i.e. 'electronics' and 'hifi'. This is because of this line of code in the Router class on line 289:
Code:
$this->_set_request(explode('/', $val));
Is this maybe a situation where _remap() comes into place?
Any ideas on how I can get 'electronics/hifi' passed into just one parameter $path in my controller functions?
Tnx in advance.
M.