1 layout.module layout_load_multiple_by_router_item($router_item, $skip_menu_items = NULL)

Load all layouts for a given router item and allow other modules to alter them and/or set their contexts.

Parameters

array $router_item: The fully built menu router item, e.g., what is returned by menu_get_item().

bool $skip_menu_items: Flag to skip the attempted loading of menu items for the loaded layouts.

Return value

Layout[]: An array of load Layout object instances.

File

core/modules/layout/layout.module, line 1225
The Layout module creates pages and wraps existing pages in layouts.

Code

function layout_load_multiple_by_router_item($router_item, $skip_menu_items = NULL) {
  $href = $router_item['href'];
  $layouts_by_item = &backdrop_static(__FUNCTION__, array());

  if (isset($layouts_by_item[$href])) {
    return $layouts_by_item[$href];
  }

  $layouts = layout_load_multiple_by_path($router_item['path'], $skip_menu_items);
  backdrop_alter('layout_load_by_router_item', $layouts, $router_item);
  $layouts_by_item[$href] = $layouts;
  return $layouts;
}