Skip to content

unset _locale parameter if matching route has been found #56

Merged
merged 1 commit into from Apr 5, 2013

3 participants

@uwej711
Symfony CMF member
uwej711 commented Apr 4, 2013

See issue #55

@dbu dbu merged commit 0169143 into symfony-cmf:master Apr 5, 2013

1 check failed

Details default The Travis build could not complete due to an error
@dbu
Symfony CMF member
dbu commented Apr 5, 2013

thanks

@dbu
Symfony CMF member
dbu commented Apr 5, 2013

hm. what if there is {_locale} in the route? should we check that before unsetting?

@uwej711
Symfony CMF member
@lsmith77
Symfony CMF member
lsmith77 commented Apr 5, 2013

we do have the locale in the route when using the SimpleCmsBundle in the multilang mode (like we do in the SE).

@uwej711
Symfony CMF member
@dbu
Symfony CMF member
dbu commented Apr 5, 2013
@lsmith77
Symfony CMF member
@uwej711
Symfony CMF member
uwej711 commented Apr 5, 2013

You do it in SimpleCmsBundle\Document\MultilangRoute.php

This could be part of the RoutingExtraBundle ?

@lsmith77
Symfony CMF member
lsmith77 commented Apr 5, 2013

sorry .. i was unclear before .. its done inside the Route itself:
https://github.com/symfony-cmf/SimpleCmsBundle/blob/master/Document/MultilangPage.php#L71

@uwej711
Symfony CMF member
uwej711 commented Apr 5, 2013

So I propose the following: we compile the route already in ContentAwareGenerator and check the variables for _locale. If it is not there, it can be safely unset. I'll try to do a PR for that.

@dbu
Symfony CMF member
dbu commented Apr 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.