public function Settings::get in Simple XML sitemap 4.x
Returns a specific sitemap setting or a default value if setting does not exist.
Parameters
string $name: Name of the setting, like 'max_links'.
mixed $default: Value to be returned if the setting does not exist in the configuration.
Return value
mixed The current setting from configuration or a default value.
File
- src/
Settings.php, line 38
Class
- Settings
- Class Settings
Namespace
Drupal\simple_sitemapCode
public function get(string $name, $default = FALSE) {
// todo Why not NULL?
$setting = $this->configFactory
->get('simple_sitemap.settings')
->get($name);
return $setting ?? $default;
}