-
What is Dependency Injection
Overview Dependency injection is a programming technique that makes a class independent of its dependencies. It achieves that by decoupling the usage of an object from its creation. Imagine you have class Page which requires Request and Permissions in order to function. In the most naive implementation you might see…
-
Dependency Injection in Vanilla
Vanilla uses garden-container for dependency injection. The \Garden\Container object is a PSR-11 (Container Interface) compliant container class. This document outlines its usage in Vanilla, rather than how to use it, so it is worth reading the in-repo documentation. Creating Container Rules Vanilla has 3 core sets of…