function public function Theme::getSetting

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

Retrieves a theme setting.


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.

4 calls to Theme::getSetting()
Theme::getCdnProvider in src/Theme.php
Retrieves the set CDN Provider instance for the theme.
Theme::getPendingUpdates in src/Theme.php
Retrieves pending updates for the theme.
Theme::getProvider in src/Theme.php
Retrieves the CDN Provider.
Theme::__construct in src/Theme.php
Theme constructor.


Defines a theme object.



Source src/Theme.php (line 537)

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