yii\helpers\ReplaceArrayValue - Yii2 类参考手册
Class yii\helpers\ReplaceArrayValue
Inheritance | yii\helpers\ReplaceArrayValue |
---|---|
Available since version | 2.0.10 |
Object that represents the replacement of array value while performing yii\helpers\ArrayHelper::merge().
Usage example:
$array1 = [
'ids' => [
1,
],
'validDomains' => [
'example.com',
'www.example.com',
],
];
$array2 = [
'ids' => [
2,
],
'validDomains' => new \yii\helpers\ReplaceArrayValue([
'yiiframework.com',
'www.yiiframework.com',
]),
];
$result = \yii\helpers\ArrayHelper::merge($array1, $array2);
The result will be
[
'ids' => [
1,
2,
],
'validDomains' => [
'yiiframework.com',
'www.yiiframework.com',
],
]
Public Properties
隐藏继承的属性 Hide inherited properties
属性Property | 类型 Type | 简介 Description | 定义在 Defined By |
---|---|---|---|
$value | mixed | Value used as replacement. | yii\helpers\ReplaceArrayValue |
Public Methods
隐藏继承的方法 Hide inherited methods
方法 Method | 简介 Description | 定义在 Defined By |
---|---|---|
__construct() | Constructor. | yii\helpers\ReplaceArrayValue |
__set_state() | Restores class state after using var_export() . |
yii\helpers\ReplaceArrayValue |
属性详情 Property Details
方法详情 Method Details
Constructor.
public void __construct ( $value ) | ||
$value | mixed | Value used as replacement. |
Restores class state after using var_export()
.
请参阅 \yii\helpers\var_export().
public static yii\helpers\ReplaceArrayValue __set_state ( $state ) | ||
$state | array | |
throws | yii\base\InvalidConfigException | when $state property does not contain |
---|