li3_behaviors\data\model\Behavior::_config()
Initializes configuration into $_config
using config()
.
- Overwrite to implement your own custom configuration merge strategies. -
Behaviors often come with different requirements towards configuration.
In some cases just a 1-dimensional array needs to be merged ($config +
$defaults
) in other cases nested multi-dimensional arrays must be merged
or even normalized in a custom way.
That's why merging the defaults with the provided configuration can be controlled easily by yourself - the implementer. By default we do a simple one-dimensional merge adding defaults and configuration to eachother. To control configuration merging overwrite this method.
Parameters
-
string
$model
Class name of the model.
-
object
$behavior
Instance of the behavior.
-
array
$config
The configuration supplied by the user.
-
array
$defaults
The default configuration for this behavior.
-
array
The
final configuration which should be set for this behavior.
Source
protected static function _config($model, Behavior $behavior, array $config, array $defaults) {
return $config + $defaults;
}