You are here

public function GeolocationFieldProvider::getTokenHelp in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/geolocation/DataProvider/GeolocationFieldProvider.php \Drupal\geolocation\Plugin\geolocation\DataProvider\GeolocationFieldProvider::getTokenHelp()

Return field item tokens.

Parameters

\Drupal\Core\Field\FieldDefinitionInterface $fieldDefinitionInterface: Field definition interface.

Return value

array Token help element.

Overrides DataProviderBase::getTokenHelp

File

src/Plugin/geolocation/DataProvider/GeolocationFieldProvider.php, line 26

Class

GeolocationFieldProvider
Provides default geolocation field.

Namespace

Drupal\geolocation\Plugin\geolocation\DataProvider

Code

public function getTokenHelp(FieldDefinitionInterface $fieldDefinition = NULL) {
  $element = parent::getTokenHelp($fieldDefinition);
  $element['token_items'][] = [
    'token' => [
      '#plain_text' => '[geolocation_current_item:lat_sex]',
    ],
    'description' => [
      '#plain_text' => $this
        ->t('Latitude value in sexagesimal notation'),
    ],
  ];
  $element['token_items'][] = [
    'token' => [
      '#plain_text' => '[geolocation_current_item:lng_sex]',
    ],
    'description' => [
      '#plain_text' => $this
        ->t('Longitude value in sexagesimal notation'),
    ],
  ];
  return $element;
}