1 layout_renderer_standard.inc LayoutRendererStandard::addCss($filename, $options = array())

Add CSS information to the renderer.

To facilitate previews over Views, CSS can now be added in a manner that does not necessarily mean just using backdrop_add_css. Therefore, during the layout rendering process, this method can be used to add css and make certain that ti gets to the proper location.

The arguments should exactly match backdrop_add_css().

See also

backdrop_add_css

File

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

Class

LayoutRendererStandard
The standard render for a Layout display object.

Code

function addCss($filename, $options = array()) {
  switch ($this->meta_location) {
    case 'standard':
      backdrop_add_css($filename, $options);
      break;
    case 'inline':
      $url = base_path() . $filename;
      $this->prefix .= '<link rel="stylesheet" href="' . $url . '" />' . "\n";
      break;
  }
}