On the rare occasion, you might want to inject the container into a service. It would be a helpful feature to be able to do with via the configuration. Maybe something like:
It would also be useful to have the container available in ServiceFactories. A common approach to this would be to have a ContainerAware interface and trait or abstract class.
Pros:
Makes it easier to inject the container into services.
Cons:
Injecting the container into services generally isn't good practice.
On the rare occasion, you might want to inject the container into a service. It would be a helpful feature to be able to do with via the configuration. Maybe something like:
It would also be useful to have the container available in ServiceFactories. A common approach to this would be to have a
ContainerAware
interface andtrait
orabstract class
.Pros:
Cons: