5

Joomla! 3.x includes DI (Dependency Injection) container. https://api.joomla.org/cms-3/classes/Joomla.DI.Container.html. I'm curious about it's usage in my joomla component. Did anyone try to set it up?

Also that would be nice to see some examples.

0

I saw it in the code but not outside of framework (in any of the extensions). I believe it gonna be used on a bigger scale in Joomla! 4. The main benefit from that is testability but there are others too. If you are not familiar with the concept you can see the explanation and some examples here:

  1. https://github.com/joomla-framework/di
  2. https://github.com/joomla-framework/di/blob/master/docs/why-dependency-injection.md

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.