Symfony2 language selector

前端 未结 5 695
深忆病人
深忆病人 2020-12-24 09:18

I would like to integrate a simple HTML form allowing the user to change Symfony2 web application\'s language (i.e. from page en/faq go to fr/faq). How to do it in a proper

5条回答
  •  不思量自难忘°
    2020-12-24 09:54

    Using the _locale parameter in your routing definition automatically sets the user locale.

    See http://symfony.com/doc/current/book/translation.html#the-locale-and-the-url

提交回复
热议问题