Previous Next

Very brief introduction to Di.

Dependency Injection is a concept that has been talked about in numerous places over the web. For the purposes of this quickstart, we'll explain the act of injecting dependencies simply with this below code:

$b = new B(new A));

Above, A is a dependency of B, and A was injected into B. If you are not familar with the concept of dependency injection, here are a couple of great reads: Matthew Weier O'Phinney's » Analogy, Ralph Schindler's » Learning DI, or Fabien Potencier's » Series on DI.

Previous Next