You are here

public function IpGeoLocViewsPluginStyle::pluginStyleAddLabel in IP Geolocation Views & Maps 8

Prefix the field value with its label, where requested. No styling.

Parameters

string $field: The field.

string $field_content: The content of the field.

Return value

string $field_content prefixed with the label defined for the field

1 call to IpGeoLocViewsPluginStyle::pluginStyleAddLabel()
IpGeoLocViewsPluginStyle::pluginStyleDecorate in src/Services/IpGeoLocViewsPluginStyle.php
Pending doc.

File

src/Services/IpGeoLocViewsPluginStyle.php, line 1139

Class

IpGeoLocViewsPluginStyle
Class IpGeoLocViewsPluginStyle.

Namespace

Drupal\ip_geoloc\Services

Code

public function pluginStyleAddLabel($field, $field_content) {
  $label = $field
    ->label();
  if ($label && $field->options['element_label_colon']) {
    $label .= ': ';
  }
  return $label . $field_content;
}