protected function HtmlResponseAttachmentsProcessor8b7c:f320:99b9:690f:4595:cd17:293a:c069processAssetLibraries protected HtmlResponseAttachmentsProcessor8b7c:f320:99b9:690f:4595:cd17:293a:c069processAssetLibraries(AttachedAssetsInterface $assets, array $placeholders) Processes asset libraries into render arrays. Parameters  \Drupal\Core\Asset\AttachedAssetsInterface $assets: The attached assets collection for the current response. array $placeholders: The placeholders that exist in the response. Return value  array An array keyed by asset type, with keys:  styles scripts scripts_bottom  File
 core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php, line 284  Class
 
HtmlResponseAttachmentsProcessor  Processes attachments of HTML responses.  Namespace Drupal\Core\Render Code protected function processAssetLibraries(AttachedAssetsInterface $assets, array $placeholders) {
  $variables = [];

  // Print styles - if present.
  if (isset($placeholders['styles'])) {
    // Optimize CSS if necessary, but only during normal site operation.
    $optimize_css = !defined('MAINTENANCE_MODE') && $this->config->get('css.preprocess');
    $variables['styles'] = $this->cssCollectionRenderer->render($this->assetResolver->getCssAssets($assets, $optimize_css));
  }

  // Print scripts - if any are present.
  if (isset($placeholders['scripts']) || isset($placeholders['scripts_bottom'])) {
    // Optimize JS if necessary, but only during normal site operation.
    $optimize_js = !defined('MAINTENANCE_MODE') && !\Drupal8b7c:f320:99b9:690f:4595:cd17:293a:c069state()->get('system.maintenance_mode') && $this->config->get('js.preprocess');
    list($js_assets_header, $js_assets_footer) = $this->assetResolver->getJsAssets($assets, $optimize_js);
    $variables['scripts'] = $this->jsCollectionRenderer->render($js_assets_header);
    $variables['scripts_bottom'] = $this->jsCollectionRenderer->render($js_assets_footer);
  }

  return $variables;
}


    
{'path': 'public/docs/drupal~8/core-lib-drupal-core-render-htmlresponseattachmentsprocessor.php/function/htmlresponseattachmentsprocessor-processassetlibraries/8.1.x.html', 'source': 'DevDocs.IO'}