You are here

public function StylePluginBase::tokenizeValue in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/style/StylePluginBase.php \Drupal\views\Plugin\views\style\StylePluginBase::tokenizeValue()

Take a value and apply token replacement logic to it.

3 calls to StylePluginBase::tokenizeValue()
Grid::getCustomClass in core/modules/views/src/Plugin/views/style/Grid.php
Return the token-replaced row or column classes for the specified result.
Rss::getDescription in core/modules/views/src/Plugin/views/style/Rss.php
Get RSS feed description.
StylePluginBase::getRowClass in core/modules/views/src/Plugin/views/style/StylePluginBase.php
Return the token replaced row class for the specified row.

File

core/modules/views/src/Plugin/views/style/StylePluginBase.php, line 233
Contains \Drupal\views\Plugin\views\style\StylePluginBase.

Class

StylePluginBase
Base class for views style plugins.

Namespace

Drupal\views\Plugin\views\style

Code

public function tokenizeValue($value, $row_index) {
  if (strpos($value, '{{') !== FALSE) {

    // Row tokens might be empty, for example for node row style.
    $tokens = isset($this->rowTokens[$row_index]) ? $this->rowTokens[$row_index] : array();
    if (!empty($this->view->build_info['substitutions'])) {
      $tokens += $this->view->build_info['substitutions'];
    }
    $value = $this
      ->viewsTokenReplace($value, $tokens);
  }
  else {

    // ::viewsTokenReplace() will run Xss::filterAdmin on the
    // resulting string. We do the same here for consistency.
    $value = Xss::filterAdmin($value);
  }
  return $value;
}