dpzzkfb1244 2012-05-09 06:47
浏览 38
已采纳

在symfony2中覆盖parameters.ini

I have got a "locale" setting in my app/config/parameters.ini and i would like to overwrite it in my bundle.

I have tried to create parameters.ini in NewAcme/MyBundle/Resource/config/parameters.ini but it does not seem to pick this setting up.

I retrive it using $this->container->getParameter('locale') but I get original value.

Any ideas? Big thanks

  • 写回答

1条回答 默认 最新

  • douxu4610 2012-05-09 06:52
    关注

    The settings in app/config are meant to overwrite the bundle config.

    The best way to get around this is to use your own config for your bundle. See this cookbook chapter on how to do this: http://symfony.com/doc/current/cookbook/bundles/extension.html

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部