You are here

protected function Page::getRoute in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/display/Page.php \Drupal\views\Plugin\views\display\Page::getRoute()

Generates a route entry for a given view and display.

Parameters

string $view_id: The ID of the view.

string $display_id: The current display ID.

Return value

\Symfony\Component\Routing\Route The route for the view.

Overrides PathPluginBase::getRoute

File

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

Class

Page
The plugin that handles a full page.

Namespace

Drupal\views\Plugin\views\display

Code

protected function getRoute($view_id, $display_id) {
  $route = parent::getRoute($view_id, $display_id);

  // Explicitly set HTML as the format for Page displays.
  $route
    ->setRequirement('_format', 'html');
  return $route;
}