You are here

public static function DataExport::buildResponse in Views data export 8

Builds up a response with the rendered view as content.

Parameters

string $view_id: The view ID.

string $display_id: The display ID.

array $args: (optional) The arguments of the view.

Return value

\Symfony\Component\HttpFoundation\Response The built response.

Overrides RestExport::buildResponse

File

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

Class

DataExport
Provides a data export display plugin.

Namespace

Drupal\views_data_export\Plugin\views\display

Code

public static function buildResponse($view_id, $display_id, array $args = [], &$view = []) {

  // Load the View we're working with and set its display ID so we can get
  // the exposed input.
  $view = Views::getView($view_id);
  $view
    ->setDisplay($display_id);
  $view
    ->setArguments($args);

  // Build different responses whether batch or standard method is used.
  if ($view->display_handler
    ->getOption('export_method') == 'batch') {
    return static::buildBatch($view, $args);
  }
  return static::buildStandard($view);
}