Google News
logo
Yii framework - Interview Questions
What is Dependency Injection Container in Yii Framework?
A dependency injection (DI) container is an object that knows how to instantiate and configure objects and all their dependent objects. Martin Fowler's article has well explained why DI container is useful. Here we will mainly explain the usage of the DI container provided by Yii.
 
Dependency Injection : Yii provides the DI container feature through the class yii\di\Container. It supports the following kinds of dependency injection:
 
* Constructor injection;
* Method injection;
* Setter and property injection;
* PHP callable injection;
Advertisement