Symfony2 default locale in routing

前端 未结 12 2285
猫巷女王i
猫巷女王i 2020-12-01 04:41

I have a problem with routing and the internationalization of my site built with Symfony2.
If I define routes in the routing.yml file, like this:

exampl         


        
12条回答
  •  生来不讨喜
    2020-12-01 05:10

    I use annotations, and i will do

    /**
     * @Route("/{_locale}/example", defaults={"_locale"=""})
     * @Route("/example", defaults={"_locale"="en"}, , requirements = {"_locale" = "fr|en|uk"})
     */
    

    But for yml way, try some equivalent...

提交回复
热议问题