Add locale and requirements to all routes - Symfony2

后端 未结 6 531
离开以前
离开以前 2021-01-04 14:12

I created an application which was not intended to have translations, but now I decided to add this feature. The problem is that all my routes look like this:



        
6条回答
  •  暖寄归人
    2021-01-04 14:40

    I think you need a custom loader extending the classic config loader (Symfony\Component\Config\Loader\Loader) and manipulate the pattern

    http://symfony.com/doc/current/cookbook/routing/custom_route_loader.html

    check the first example, i haven't tried it yet, but i'm quite sure it will fit your problem.

提交回复
热议问题