Symfony2: How to inject ALL parameters in a service?

后端 未结 7 889
既然无缘
既然无缘 2020-12-28 14:14

How can I inject ALL parameters in a service?

I know I can do: arguments: [%some.key%] which will pass the parameters: some.key: \"value\"

7条回答
  •  悲哀的现实
    2020-12-28 15:01

    I believe you're supposed to pass the parameters individually. I think it's made that way by design so your service class is not dependent on the AppKernel. That way you can reuse your service class outside your Symfony project. Something that is useful when testing your service class.

提交回复
热议问题