I’m trying to build a URL to be used for language switching and path_for, which is being called like this:
{{ path_for('home', { 'lang': 'en' }) }}
simple generates a link to “/” thus ignoring the expected lang=en part which should be generated. Chances are it’s me, so I have to ask: What am I doing wrong?
If this is the same app as you posted the route definitions for in the other thread, then you are not specifying where the lang param should go in the route definition.
@TheLobos Docs are fine. There is an example shown where the $data sent into path_for has a placeholder {name} in the route. What you are trying to do is different. You want to add a query parameter, which is the 3rd parameter of path_for.