A
A
Alexander Fedorov2015-09-26 23:02:10
Yii
Alexander Fedorov, 2015-09-26 23:02:10

How to put the widget parameter (pjax) in config\main-local.php in Yii2?

Can you please tell me how to set the widget parameter in the application config? Do I need additional code when calling the widget to apply these settings?
As far as I understood from the Configurations section of the Yii2 guide, the parameters specified in the configuration files are applied during the initialization of each object and there is no need to specify them anywhere else.
But both in the examples and in the config files themselves, parameters for components are specified, but nowhere is there an example for widgets.
Speaking specifically, we are talking about the 'timeout' parameter of the pjax widget. Response rates are different on different environments, so I would like to configure this setting for all pjax calls in the application in one place.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
matperez, 2015-09-26
@Pagliaccio

And what parameter do you want to set through the config? You can refer to Yii::$app->params right inside the widget, or here is an example of configuration through the container.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question