You are here

public function ViewExecutable::getTitle in Views (for Drupal 7) 8.3

Get the view's current title. This can change depending upon how it was built.

1 call to ViewExecutable::getTitle()
ViewUI::renderPreview in views_ui/lib/Drupal/views_ui/ViewUI.php

File

lib/Drupal/views/ViewExecutable.php, line 1578
Definition of Drupal\views\ViewExecutable.

Class

ViewExecutable
An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.

Namespace

Drupal\views

Code

public function getTitle() {
  if (empty($this->display_handler)) {
    if (!$this
      ->setDisplay('default')) {
      return FALSE;
    }
  }

  // During building, we might find a title override. If so, use it.
  if (!empty($this->build_info['title'])) {
    $title = $this->build_info['title'];
  }
  else {
    $title = $this->display_handler
      ->getOption('title');
  }

  // Allow substitutions from the first row.
  if ($this
    ->initStyle()) {
    $title = $this->style_plugin
      ->tokenize_value($title, 0);
  }
  return $title;
}