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

Breadcrumb

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

function Page::execute

Overrides PathPluginBase::execute

File

core/modules/views/src/Plugin/views/display/Page.php, line 197

Class

Page
The plugin that handles a full page.

Namespace

Drupal\views\Plugin\views\display

Code

public function execute() {
    parent::execute();
    // And now render the view.
    $render = $this->view
        ->render();
    // First execute the view so it's possible to get tokens for the title.
    // And the title, which is much easier.
    // @todo Figure out how to support custom response objects. Maybe for pages
    //   it should be dropped.
    if (is_array($render)) {
        $render += [
            '#title' => [
                '#markup' => $this->view
                    ->getTitle(),
                '#allowed_tags' => Xss::getHtmlTagList(),
            ],
        ];
    }
    return $render;
}

API Navigation

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