You are here

protected function DataExport::getRoute in Views data export 8

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

src/Plugin/views/display/DataExport.php, line 921

Class

DataExport
Provides a data export display plugin.

Namespace

Drupal\views_data_export\Plugin\views\display

Code

protected function getRoute($view_id, $display_id) {
  $route = parent::getRoute($view_id, $display_id);
  $view = Views::getView($view_id);
  $view
    ->setDisplay($display_id);

  // If this display is going to perform a redirect to the batch url
  // make sure thr redirect response is never cached.
  if ($view->display_handler
    ->getOption('export_method') == 'batch') {
    $route
      ->setOption('no_cache', TRUE);
  }
  return $route;
}