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
$modelClass name of the model.
-
object
$behaviorInstance of the behavior.
-
array
$configThe configuration supplied by the user.
-
array
$defaultsThe default configuration for this behavior.
-
array
Thefinal configuration which should be set for this behavior.
Source
protected static function _config($model, $behavior, $config, $defaults) {
return $config + $defaults;
}