1 layout_renderer_standard.inc LayoutRendererStandard::addMeta()

Attach out-of-band page metadata (e.g., CSS and JS).

This must be done before render, because layouts-within-layouts must have their CSS added in the right order: inner content before outer content.

File

core/modules/layout/plugins/renderers/layout_renderer_standard.inc, line 398

Class

LayoutRendererStandard
The standard render for a Layout display object.

Code

function addMeta() {
  if (!empty($this->layout_info['stylesheets'])) {
    foreach ($this->layout_info['stylesheets'] as $media => $file_names) {
      foreach ($file_names as $file_name) {
        $this->addCss($this->layout_info['path'] . '/' . $file_name, array('media' => $media));
      }
    }
  }
  if (!empty($this->layout_info['libraries'])) {
    foreach ($this->layout_info['libraries'] as $library) {
      $this->addLibrary('layout', $library);
    }
  }
}