为 InvalidConfigurationException 配置 jms_i18n_routing
configure jms_i18n_routing for InvalidConfigurationException
我想使用 JMSi18nRoutingBundle。所以我已经在我的项目中安装了它。现在,当我尝试 运行 服务器时,命令行显示:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The child node "default_locale" at path "jms_i18n_routing" must be configured.
但是这个文件中的路径是动态的,只能通过setPath()
方法来改变。那么我必须在哪里以及如何配置它?
ok 解决了!
JMSi18nRoutingBundle 的配置:
jms_i18n_routing:
default_locale: en
locales: [en, de]
strategy: prefix
需要写在config.yml
。除此之外,还必须启用 Config 中的 Translator。就这些了。
我想使用 JMSi18nRoutingBundle。所以我已经在我的项目中安装了它。现在,当我尝试 运行 服务器时,命令行显示:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The child node "default_locale" at path "jms_i18n_routing" must be configured.
但是这个文件中的路径是动态的,只能通过setPath()
方法来改变。那么我必须在哪里以及如何配置它?
ok 解决了!
JMSi18nRoutingBundle 的配置:
jms_i18n_routing:
default_locale: en
locales: [en, de]
strategy: prefix
需要写在config.yml
。除此之外,还必须启用 Config 中的 Translator。就这些了。