Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ViewPageController.php

function ViewPageController::getTitle

Gets the title of the given view's display.

Parameters

string $view_id: The id of the view.

string $display_id: The id of the display from the view.

Return value

string|\Drupal\Component\Render\MarkupInterface The title of the display of the view.

File

core/modules/views/src/Routing/ViewPageController.php, line 80

Class

ViewPageController
Defines a page controller to execute and render a view.

Namespace

Drupal\views\Routing

Code

public function getTitle($view_id, $display_id = 'default') {
    $view = Views::getView($view_id);
    $view->setDisplay($display_id);
    return ViewsRenderPipelineMarkup::create(Xss::filter($view->getTitle()));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal