Inject additional configuration into custom Entity/Document Manager

◇◆丶佛笑我妖孽 提交于 2019-12-12 02:35:45

问题


I made a custom Document Manager for my project implementing some new low level functions (following this post).

Now I would like to inject a custom configuration in my new Document Manager (I suppose it would be the same with an Entity Manager). I have no idea of how to do this...

I want this config in my yaml files to set my custom Document Manager's parameters. The only way I found until now is to write a static function returning a hardcoded array of configuration, but it's a little dirty...)

Is there a proper way or an alternative to do this?


回答1:


For defining custom configuration in the conig.yml file, use this symfony docs. You can access those configurations easily in a controller:

$this->container->getParameter(name_of_bundle_here)


来源:https://stackoverflow.com/questions/20757571/inject-additional-configuration-into-custom-entity-document-manager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!