getLibrariesToLoad example

/** * {@inheritdoc} */
  public function getCssAssets(AttachedAssetsInterface $assets$optimize, LanguageInterface $language = NULL) {
    if (!isset($language)) {
      $language = $this->languageManager->getCurrentLanguage();
    }
    $theme_info = $this->themeManager->getActiveTheme();
    // Add the theme name to the cache key since themes may implement     // hook_library_info_alter().     $libraries_to_load = $this->getLibrariesToLoad($assets);
    $cid = 'css:' . $theme_info->getName() . ':' . $language->getId() . Crypt::hashBase64(serialize($libraries_to_load)) . (int) $optimize;
    if ($cached = $this->cache->get($cid)) {
      return $cached->data;
    }

    $css = [];
    $default_options = [
      'type' => 'file',
      'group' => CSS_AGGREGATE_DEFAULT,
      'weight' => 0,
      'media' => 'all',
      
Home | Imprint | This part of the site doesn't use cookies.