Modify bundle configuration from another bundle

前端 未结 2 1173
暖寄归人
暖寄归人 2020-12-31 18:58

I was wondering whether there\'s a possible to modify a bundles configuration from another bundle. Let\'s say, for example, I\'m using the FOSUserBundle with the following c

相关标签:
2条回答
  • 2020-12-31 19:20

    After asking the same question on the Symfony user mailing list (here's the question), I've found out that there's an open pull request for this idea.

    It is for version 2.2 and not yet merged into master, but the last activity is from 3 days ago, so let's hope for the best!

    0 讨论(0)
  • 2020-12-31 19:26

    It should be noted that this is now an official feature of Symfony:

    http://symfony.com/doc/current/cookbook/bundles/prepend_extension.html

    A bundle can prepend configuration values to the global config parameters. To do that, the bundle extension must implement PrependExtensionInterface. The prepend() method can then add global configuration values.

    Note, however, that the values may be overwritten by other bundles and in the config file itself.

    0 讨论(0)
提交回复
热议问题