public function BackgroundImageSettings::drupalSettings in Background Image 8
Same name and namespace in other branches
- 2.x src/BackgroundImageSettings.php \Drupal\background_image\BackgroundImageSettings::drupalSettings()
- 2.0.x src/BackgroundImageSettings.php \Drupal\background_image\BackgroundImageSettings::drupalSettings()
Retrieves the data currently set as a drupalSettings array.
Parameters
string $name: A specific setting to retrieve. If not set, the entire settings array will be returned.
Return value
array The data.
File
- src/
BackgroundImageSettings.php, line 52
Class
Namespace
Drupal\background_imageCode
public function drupalSettings($name = '') {
$data = self::snakeCaseToCamelCase(empty($name) ? $this
->get() : [
$name => $this
->get($name),
]);
if (empty($name)) {
return $data;
}
return reset($data);
}