我的语言环境声明parameters.yml
parameters:
locale: en
locales: [ en, de, fr, it, es, pt, ru, ja, zh ]
并想重用locales
参数routing.yml
homepage_locale:
pattern: /{_locale}
defaults: { _controller: SiteBundle:World:index }
requirements: { _locale: %locales% }
但这显然会导致
The container parameter "locales", used in the route configuration value
"%locales%", must be a string or numeric, but it is of type array.
有没有办法重用这个参数,或者我真的必须把语言环境写成一个字符串来满足这个 yaml/regex 格式,像这样:
en|de|fr|it|es|pt|ru|ja|zh