1 layout.module layout_load_multiple_by_path($path, $skip_menu_items = NULL)

Load all layouts at a given path.

Parameters

string $path: The menu routing path, with all placeholders represented by "%" symbols.

Return value

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

File

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

Code

function layout_load_multiple_by_path($path, $skip_menu_items = NULL) {
  if ($cache = cache('layout_path')->get($path)) {
    $layouts = $cache->data;

    // Populate these cached layouts into layout_load_multiple() to optimize
    // any future calls to it.
    $static_cache = &backdrop_static('layout_load_multiple', array());
    $static_cache = array_merge($layouts, $static_cache);
  }
  else {
    $layout_names = layout_get_path_layout_names($path);
    if (empty($layout_names)) {
      // Skip loading menu items for the default layouts.
      if (is_null($skip_menu_items)) {
        $skip_menu_items = TRUE;
      }
      if (path_is_admin($path)) {
        $layout_names[] = 'admin_default';
      }
      else {
        $layout_names[] = 'default';
      }
    }

    $layouts = layout_load_multiple($layout_names, $skip_menu_items);
    cache('layout_path')->set($path, $layouts);
  }
  return $layouts;
}