You are here

function yamaps_preprocess_page in Yandex.Maps 8

Implements yamaps_preprocess_page().

File

./yamaps.module, line 48
Yandex Maps module main file.

Code

function yamaps_preprocess_page(&$variables) {
  $current_path = \Drupal::service('path.current')
    ->getPath();
  $patterns = "/admin/structure/block/*\n/admin/structure/views/*";
  if (\Drupal::service('path.matcher')
    ->matchPath($current_path, $patterns)) {
    $variables['#attached']['library'][] = 'yamaps/yandex-map-api';
  }
}