1 layout.class.inc Layout::resetContexts()

Reset the internally stored contexts.

This is used before storing a layout, or when fresh contexts are important, such as when actively changing the layout's path.

File

core/modules/layout/includes/layout.class.inc, line 902
Class for loading, modifying, and executing a layout.

Class

Layout
@file Class for loading, modifying, and executing a layout.

Code

function resetContexts() {
  foreach ($this->contexts as $key => $context) {
    if (!$context->storage) {
      unset($this->contexts[$key]);
    }
  }
  if ($this->menu_item) {
    $this->menu_item->resetContexts();
  }
}