protected static function BackgroundImageSettings::snakeCaseToCamelCase in Background Image 2.0.x
Same name and namespace in other branches
- 8 src/BackgroundImageSettings.php \Drupal\background_image\BackgroundImageSettings::snakeCaseToCamelCase()
- 2.x src/BackgroundImageSettings.php \Drupal\background_image\BackgroundImageSettings::snakeCaseToCamelCase()
Converts snake_case_keys into camelCaseKeys.
Parameters
array $array: An array to iterate over.
Return value
array The converted array.
1 call to BackgroundImageSettings::snakeCaseToCamelCase()
- BackgroundImageSettings::drupalSettings in src/
BackgroundImageSettings.php - Retrieves the data currently set as a drupalSettings array.
File
- src/
BackgroundImageSettings.php, line 209
Class
Namespace
Drupal\background_imageCode
protected static function snakeCaseToCamelCase(array $array = []) {
$converter = new CamelCaseToSnakeCaseNameConverter();
$data = [];
foreach ($array as $key => $value) {
$data[$converter
->denormalize($key)] = is_array($value) ? self::snakeCaseToCamelCase($value) : $value;
}
ksort($data);
return $data;
}