From 4f59ec2f5bf7f8e87ad83e09208c5927a9a4a14b Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Fri, 6 Jan 2017 13:57:49 +0100 Subject: [PATCH] Update concept-di-container.md --- docs/guide/concept-di-container.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/guide/concept-di-container.md b/docs/guide/concept-di-container.md index 5f3985a470a..2f9d4553053 100644 --- a/docs/guide/concept-di-container.md +++ b/docs/guide/concept-di-container.md @@ -336,7 +336,9 @@ You can still override the value set via DI container, though: echo \yii\widgets\LinkPager::widget(['maxButtonCount' => 20]); ``` -> Tip: no matter which value type it is, it will be overwritten so be careful with option arrays. They won't be merged. +> Note: Properties given in the widget call will always override the definition in the DI container. +> Even if you specify an array, e.g. `'options' => ['id' => 'mypager']` these will not be merged +> with other options but replace them. Another example is to take advantage of the automatic constructor injection of the DI container. Assume your controller class depends on some other objects, such as a hotel booking service. You