You are here

public function InstapageCmsPluginDrupal8Connector::getSitename in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/connectors/InstapageCmsPluginDrupal8Connector.php \InstapageCmsPluginDrupal8Connector::getSitename()

Gets the sitename from CMS config.

Return value

string Sitename.

File

core/connectors/InstapageCmsPluginDrupal8Connector.php, line 644

Class

InstapageCmsPluginDrupal8Connector
Class that utilizes native Drupal 8 functions to perform actions like remote requests and DB operations.

Code

public function getSitename($sanitized = false) {
  $sitename = \Drupal::config('system.site')
    ->get('name');
  if ($sanitized) {
    return mb_strtolower(str_replace(' ', '-', $sitename), 'UTF-8');
  }
  return $sitename;
}