I took a look into RouteCompiler.php code and noticed that functionality could be implemented not that hard. Just by throwing in some additional settings array, where you could set which placeholders are optional, and instead wrapping them like that: /(?P<placeholdername>placeholderregex) do this way for optional placeholder: (?:/(?P<placeholdername>placeholderindex))?
On Fri, Feb 25, 2011 at 12:30 PM, <[email protected]> wrote: > Hey, > I encountered big limitation of routing patterns today. > > Use case: > We need to be able to show article in 2 languages, with optional > requirement to have culture placeholder in url. > Right now pattern would look like this: > /articles/{culture}/{year}/{title}.{_format} => > /articles/en/2011/nicearticle.html > However this limits having culture in url, it is not possible to have > url like this, and e.g. load culture from session/cookie or geoip > database: > /articles/2011/nicearticle.html > > I see 2 solutions now: > 1. Regex support in pattern setting which would allow to solve this > easily and would add more flexibility. > 2. Fallback pattern support (this sounds ugly). > > -- > Aurelijus ValeiĊĦa > +370-618-19765 > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
