mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-26 03:30:32 +08:00
View default value for $params
To prevent Warning "Trying to get property of non-object" in case when nothing set to params, but you try to get some key (check is there something) ArrayHelper::getValue($this->view->params, 'abc');
This commit is contained in:
@@ -96,7 +96,7 @@ class View extends Component
|
|||||||
/**
|
/**
|
||||||
* @var mixed custom parameters that are shared among view templates.
|
* @var mixed custom parameters that are shared among view templates.
|
||||||
*/
|
*/
|
||||||
public $params;
|
public $params = array();
|
||||||
/**
|
/**
|
||||||
* @var array a list of available renderers indexed by their corresponding supported file extensions.
|
* @var array a list of available renderers indexed by their corresponding supported file extensions.
|
||||||
* Each renderer may be a view renderer object or the configuration for creating the renderer object.
|
* Each renderer may be a view renderer object or the configuration for creating the renderer object.
|
||||||
|
|||||||
Reference in New Issue
Block a user