diff --git a/docs/guide/concept-di-container.md b/docs/guide/concept-di-container.md index 57b35e18af..bcb32b52c1 100644 --- a/docs/guide/concept-di-container.md +++ b/docs/guide/concept-di-container.md @@ -15,6 +15,7 @@ dependency injection: * Constructor injection; * Setter and property injection; * PHP callable injection. +* Controller action injection. ### Constructor Injection @@ -116,10 +117,12 @@ $foo = $container->get('Foo'); By doing so, the person who wants to configure the `Foo` class no longer needs to be aware of how it is built. -### Controller action injection +### Controller action injection -Controller action injection is a special type of DI where dependecies are resolved per action which is useful for -keeping dependencies number low in MVC controllers. +Controller action injection is a special type of DI where dependecies are declared using the type hints of +method signature and resolved in the runtime when the action is acturally called. It is useful for keeping +the MVC controllers slim and light-weighted since it doesn't require you to configure all the possible dependencies +of the controller beforehand. ```php public function actionSend($email, EmailValidator $validator)