function public function Theme::getAncestry

8.x-3.x Theme.php public Theme::getAncestry($reverse = FALSE)

Retrieves the full base/sub-theme ancestry of a theme.

Parameters

bool $reverse: Whether or not to return the array of themes in reverse order, where the active theme is the first entry.

Return value

\Drupal\bootstrap\Theme[] An associative array of \Drupal\bootstrap objects (theme), keyed by machine name.

Class

Theme
Defines a theme object.

Namespace

Drupal\bootstrap

Source src/Theme.php (line 370)

public function getAncestry($reverse = FALSE) {
  $ancestry = $this->themeHandler->getBaseThemes($this->themes, $this->getName());
  foreach (array_keys($ancestry) as $name) {
    $ancestry[$name] = Bootstrap::getTheme($name, $this->themeHandler);
  }
  $ancestry[$this->getName()] = $this;
  return $reverse ? array_reverse($ancestry) : $ancestry;
}