function public function Theme::getSetting

8.x-3.x Theme.php public Theme::getSetting($name, $default = NULL)

Retrieves a theme setting.

Parameters

string $name: The name of the setting to be retrieved.

mixed $default: A default value to provide if the setting is not found or if the plugin does not have a "defaultValue" annotation key/value pair. Typically, you will likely never need to use this unless in rare circumstances where the setting plugin exists but needs a default value not able to be set by conventional means (e.g. empty array).

Return value

mixed The value of the requested setting, NULL if the setting does not exist and no $default value was provided.

Class

Theme
Defines a theme object.

Namespace

Drupal\bootstrap

Source src/Theme.php (line 538)

public function getSetting($name, $default = NULL) {
  $value = $this->settings()->get($name);
  return !isset($value) ? $default : $value;
}