diff --git a/docs/guide/structure-widgets.md b/docs/guide/structure-widgets.md index 0529b278eb..27cde16ff7 100644 --- a/docs/guide/structure-widgets.md +++ b/docs/guide/structure-widgets.md @@ -69,6 +69,18 @@ Note that unlike [[yii\base\Widget::widget()]] which returns the rendering resul [[yii\base\Widget::begin()]] returns an instance of the widget which you can use to build the widget content. +### Configuring global defaults + +Global defaults for a widget type could be configured via DI container: + +```php +\Yii::$container->set('yii\widgets\LinkPager', ['maxButtonCount' => 5]); +``` + +See ["Practical Usage" section in Dependency Injection Container guide](concept-di-container.md#practical-usage) for +details. + + ## Creating Widgets To create a widget, extend from [[yii\base\Widget]] and override the [[yii\base\Widget::init()]] and/or