Inject additional configuration into custom Entity

2019-08-23 06:30发布

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条回答
2楼-- · 2019-08-23 06:52

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)
查看更多
登录 后发表回答