You are here

public function Title::preRender in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/area/Title.php \Drupal\views\Plugin\views\area\Title::preRender()
  2. 9 core/modules/views/src/Plugin/views/area/Title.php \Drupal\views\Plugin\views\area\Title::preRender()

Performs any operations needed before full rendering.

Parameters

array $results: The results of the view.

Overrides AreaPluginBase::preRender

File

core/modules/views/src/Plugin/views/area/Title.php, line 45

Class

Title
Views area title override handler.

Namespace

Drupal\views\Plugin\views\area

Code

public function preRender(array $results) {
  parent::preRender($results);

  // If a title is provided, process it.
  if (!empty($this->options['title'])) {
    $value = $this
      ->globalTokenReplace($this->options['title']);
    $this->view
      ->setTitle($this
      ->sanitizeValue($value, 'xss_admin'));
  }
}