Hi All,
I’m trying to minimaize the number of UrlManager rules to make the application work faster. There are couple of very similar rules and I’m wondering whether it’s possible to combine them into one.
I’d like to handle creation of these cases:
news-1
news-1-foo-bar
news-1-foo-bar/3
news-1/3
So in general the url should be in a form similar to this: news-<id:\d+>-<name:\w+>/<page:\d+>
id is mandatory, name and page optionals. As you can see the main difference between this case and “standard” one is that for some part of the url I need to use hyphens as a delimiter.
I’ve tried different regexps with “defaults” values - no luck, so I’m just thinking if it’s possible to handle such scenario using default UrlManager and UrlRule implementation?