You are here

public function ArchiveDownloader::redirectWithArchivePath in Content Synchronizer 3.x

Same name and namespace in other branches
  1. 8.2 src/Service/ArchiveDownloader.php \Drupal\content_synchronizer\Service\ArchiveDownloader::redirectWithArchivePath()
  2. 8 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 83

Class

ArchiveDownloader
Class ArchiveDownloader.

Namespace

Drupal\content_synchronizer\Service

Code

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