Symfony 4.4 Add current locale to generateURL function

  locale, routes, symfony

I have route configuration like this

controllers:
 resource: '../src/Controller/'
 type: annotation
 prefix:
  en: '' 
  '*': '/{_locale}'

this works very good, attribute override locale

but when i use generateURL i must always add code to get current locale and set it

how to do it automatically?

Source: Symfony Questions

LEAVE A COMMENT