You are here

public function Page::execute in Views (for Drupal 7) 8.3

The display page handler returns a normal view, but it also does a drupal_set_title for the page, and does a views_set_page_view on the view.

Overrides DisplayPluginBase::execute

1 method overrides Page::execute()
Feed::execute in lib/Drupal/views/Plugin/views/display/Feed.php
Feeds do not go through the normal page theming mechanism. Instead, they go through their own little theme function and then return NULL so that Drupal believes that the page has already rendered itself...which it has.

File

lib/Drupal/views/Plugin/views/display/Page.php, line 235
Definition of Drupal\views\Plugin\views\display\Page.

Class

Page
The plugin that handles a full page.

Namespace

Drupal\views\Plugin\views\display

Code

public function execute() {

  // Let the world know that this is the page view we're using.
  views_set_page_view($this->view);

  // Prior to this being called, the $view should already be set to this
  // display, and arguments should be set on the view.
  $this->view
    ->build();
  if (!empty($this->view->build_info['fail'])) {
    throw new NotFoundHttpException();
  }
  if (!empty($this->view->build_info['denied'])) {
    throw new AccessDeniedHttpException();
  }
  $this->view
    ->getBreadcrumb(TRUE);

  // 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.
  drupal_set_title(filter_xss_admin($this->view
    ->getTitle()), PASS_THROUGH);
  return $render;
}