urlmanager infinite named parameters

I’m looking for a way to have infinite named parameters for my product’s categories and sub-categories:

/product/view/cat0/iphone-3gs/cat1/iphone-protection/categorie/plastic-protection/slug/ioteck-blue-slim-protection.html

Something like this would have been perfect, but looks like CUrlmanager is too limited: ‘product/view/[<cat\d:\s+>]+/<categorie:\s+>/<slug:\s+>’ => array(‘product/view’),

What for you want to have so long URLs?

for google

Ok. Why not to display entire branch of the tree in breadcrumbs, but in URL leave only the last category.

Yes I think I may do that or add three routes to have the first three categories at maximum.

I made a function $article->getRoute()

I think it would have been efficient to have route alias with model var binding so we can change the route format without changing all CHtml::link() in code

Regex in attributes will not be supported I guess. Each are unique entities. So just do:


<cat:\d+>/<catSlug:\w+>

Also as already noted the url’s are way too long.

This is way better:

/product/0-iphone-3gs/1-protection/plastic/ioteck-blue-slim-protection.html

ok thanks for your help. I will do that.