You are here

public function BrowseTokens::tokenReplace in Views Token Argument 8

Same name and namespace in other branches
  1. 2.0.x src/BrowseTokens.php \Drupal\views_argument_token\BrowseTokens::tokenReplace()

Gatekeeper function to direct to either the core or contributed Token.

@todo: update with latest info from token modules.

File

src/BrowseTokens.php, line 47

Class

BrowseTokens
Token handling service. Uses core token service or contributed Token.

Namespace

Drupal\views_argument_token

Code

public function tokenReplace($string, $data, $settings = array()) {
  if ($this->moduleHandler
    ->moduleExists('token')) {
    return $this
      ->contribReplace($string, $data, $settings);
  }
  else {
    return $this
      ->coreReplace($string, $data, $settings);
  }
}