From ad8aa333c96bd7ac3cb9721bd7920458d85de9c6 Mon Sep 17 00:00:00 2001 From: Nobuo Kihara Date: Tue, 29 Sep 2015 21:53:57 +0900 Subject: [PATCH] docs/guide/concept-di-container.md revised [ci skip] --- docs/guide/concept-di-container.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/guide/concept-di-container.md b/docs/guide/concept-di-container.md index 57b35e18af..ee969809f0 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. +* Method signiture 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 +### Method signature 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. +Method signature injection is a special type of DI where dependecies are declared using the type hints of +method signatures and resolved in the runtime when the method is acturally called. It is particularly 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)