function PathPluginBase::collectRoutes

Same name and namespace in other branches
  1. 11.x core/modules/views/src/Plugin/views/display/PathPluginBase.php \Drupal\views\Plugin\views\display\PathPluginBase::collectRoutes()

File

core/modules/views/src/Plugin/views/display/PathPluginBase.php, line 221

Class

PathPluginBase
The base display plugin for path/callbacks. This is used for pages and feeds.

Namespace

Drupal\views\Plugin\views\display

Code

public function collectRoutes(RouteCollection $collection) {
  $view_id = $this->view->storage
    ->id();
  $display_id = $this->display['id'];
  $route = $this->getRoute($view_id, $display_id);
  if (!$route_name = $this->getOption('route_name')) {
    $route_name = "view.{$view_id}.{$display_id}";
  }
  $collection->add($route_name, $route);
  return [
    "{$view_id}.{$display_id}" => $route_name,
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.