You are here

public function IpGeoLocGlobal::prettyPrint in IP Geolocation Views & Maps 8

Print the location array nicely.

Parameters

array $location: Array of location components.

Return value

string The location array formatted as string.

File

src/Services/IpGeoLocGlobal.php, line 312

Class

IpGeoLocGlobal
Class IpGeoLocGlobal.

Namespace

Drupal\ip_geoloc\Services

Code

public function prettyPrint(array $location) {
  $t = '';
  foreach ($location as $label => $value) {
    if (!empty($value)) {
      $t .= SafeMarkup::checkPlain($label) . ':&nbsp;<strong>' . SafeMarkup::checkPlain($value) . '</strong>&nbsp; ';
    }
  }
  return empty($t) ? t('nothing') : $t;
}