Symfony2 default locale in routing

前端 未结 12 2281
猫巷女王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

    Maybe I solved this in a reasonably simple way:

    example:
        path:      '/{_locale}{_S}example'
        defaults:  { _controller: 'AppBundle:Example:index' , _locale="de" , _S: "/" }
        requirements:
            _S: "/?"
            _locale: '|de|en|fr'
    

    Curious about the judgement of the critics ... Best wishes, Greg

提交回复
热议问题