You are here

public function TokenSettingTypeBase::getTokenService in UI Patterns Settings 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/TokenSettingTypeBase.php \Drupal\ui_patterns_settings\Plugin\TokenSettingTypeBase::getTokenService()

Gets the token service.

Return value

\Drupal\Core\Utility\Token The token service.

File

src/Plugin/TokenSettingTypeBase.php, line 107

Class

TokenSettingTypeBase
Base class for setting types with tokens.

Namespace

Drupal\ui_patterns_settings\Plugin

Code

public function getTokenService() {
  if (!$this->tokenService) {
    $this->tokenService = \Drupal::token();
  }
  return $this->tokenService;
}