You are here

public function ExcelExport::render in Excel Serialization 8

Renders this display.

Overrides RestExport::render

File

src/Plugin/views/display/ExcelExport.php, line 66

Class

ExcelExport
Provides an Excel export display plugin.

Namespace

Drupal\xls_serialization\Plugin\views\display

Code

public function render() {

  // Add the content disposition header if a custom filename has been used.
  if (($response = $this->view
    ->getResponse()) && $this
    ->getOption('filename')) {
    $response->headers
      ->set('Content-Disposition', 'attachment; filename="' . $this
      ->generateFilename($this
      ->getOption('filename')) . '"');
  }
  return parent::render();
}