You are here

public function ArchiveDownloader::redirectWithArchivePath in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Service/ArchiveDownloader.php \Drupal\content_synchronizer\Service\ArchiveDownloader::redirectWithArchivePath()
  2. 3.x src/Service/ArchiveDownloader.php \Drupal\content_synchronizer\Service\ArchiveDownloader::redirectWithArchivePath()

Redirect to the page with download.

Parameters

string $redirectUrl: The url.

string $archiveUri: The archiev url.

File

src/Service/ArchiveDownloader.php, line 53

Class

ArchiveDownloader
Class ArchiveDownloader.

Namespace

Drupal\content_synchronizer\Service

Code

public function redirectWithArchivePath($redirectUrl, $archiveUri) {
  $path = str_replace(ExportEntityWriter::GENERATOR_DIR, '', $archiveUri);
  $redirectUrl .= "#" . static::ARCHIVE_PARAMS . '=' . urlencode($path);
  $redirect = new RedirectResponse($redirectUrl);
  $redirect
    ->send();
}