You are here

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

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

Donwload archive by adding js library.

Parameters

array $vars: Preprocess data.

File

src/Service/ArchiveDownloader.php, line 55

Class

ArchiveDownloader
Class ArchiveDownloader.

Namespace

Drupal\content_synchronizer\Service

Code

public function donwloadArchive(array &$vars) {
  if ($this
    ->canDownload()) {
    $vars['#attached']['library'][] = 'content_synchronizer/download_archive';
    $vars['#attached']['drupalSettings']['content_synchronizer']['download_archive_path'] = Url::fromRoute('content_synchronizer.download_archive')
      ->getInternalPath();
  }
}