1.20.x layout_renderer_standard.inc LayoutRendererStandard::renderLayout()

Perform display/layout-level render operations.

This method triggers all the inner block/region rendering processes, passes that to the layout plugin's theme callback, and returns the rendered HTML.

If display-level caching is enabled and that cache is warm, this method will not be called.

Return value

string: The HTML string representing the entire rendered, themed layout.

File

modules/layout/plugins/renderers/layout_renderer_standard.inc, line 365

Class

LayoutRendererStandard
The standard render for a Layout display object.

Code

function renderLayout() {
  if (empty($this->prep_run)) {
    $this->prepare();
  }

  $this->renderBlocks();

  // Return 404 or 403 if set by the main content block.
  if ($this->menu_response) {
    return $this->menu_response;
  }

  $this->renderRegions();

  if ($this->page_title) {
    backdrop_set_title($this->page_title);
  }

  module_load_include('inc', 'layout', 'layout.theme');
  if (empty($this->layout_info['template'])) {
    $theme = 'layout__' . $this->layout->layout_template;
  }
  else {
    $theme = str_replace('-', '_', $this->layout_info['template']);
  }
  $this->rendered['layout'] = theme($theme, array('content' => $this->rendered['regions'], 'settings' => $this->layout->settings, 'layout' => $this->layout, 'layout_info' => $this->layout_info, 'renderer' => $this, 'admin' => $this->admin));
  return $this->prefix . $this->rendered['layout'] . $this->suffix;
}