You are here

public function PluginBase::globalTokenReplace in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/PluginBase.php \Drupal\views\Plugin\views\PluginBase::globalTokenReplace()

Returns a string with any core tokens replaced.

Parameters

string $string: The string to preform the token replacement on.

array $options: An array of options, as passed to \Drupal\Core\Utility\Token::replace().

Return value

string The tokenized string.

Overrides ViewsPluginInterface::globalTokenReplace

3 calls to PluginBase::globalTokenReplace()
TestExample::render in core/modules/views/tests/modules/views_test_data/src/Plugin/views/area/TestExample.php
Render the area.
Title::preRender in core/modules/views/src/Plugin/views/area/Title.php
Performs any operations needed before full rendering.
TokenizeAreaPluginBase::tokenizeValue in core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php
Replaces value with special views tokens and global tokens.

File

core/modules/views/src/Plugin/views/PluginBase.php, line 338

Class

PluginBase
Base class for any views plugin types.

Namespace

Drupal\views\Plugin\views

Code

public function globalTokenReplace($string = '', array $options = []) {
  return \Drupal::token()
    ->replace($string, [
    'view' => $this->view,
  ], $options);
}