Final Class Yiisoft\Config\Modifier\RecursiveMerge
| Inheritance | Yiisoft\Config\Modifier\RecursiveMerge |
|---|
Enable recursive merge for specified groups.
The modifier should be specified as
RecursiveMerge::groups('params', 'events')
For example:
- configuration in application
composer.json:
"config-plugin": {
"params": "params.php",
}
- application
params.phpcontents:
return [
'key' => [
'a' => 1,
'b' => 2,
],
];
- configuration in vendor package:
"config-plugin": {
"params": "params.php",
}
- vendor package
params.phpcontents:
return [
'key' => [
'c' => 3,
'd' => 4,
],
];
- getting configuration:
$config = new Config(new ConfigPaths($configsDir), null, [
RecursiveMerge::groups('params')
]);
$result = $config->get('params');
The result will be:
[
'key' => [
'c' => 3,
'd' => 4,
'a' => 1,
'b' => 2,
],
]
Public Methods
Method Details
| public static self groups ( string $groups ) | ||
| $groups | string | |
public static function groups(string ...$groups): self
{
return new self($groups);
}
Signup or Login in order to comment.