/** * Returns theme inheritance hierarchy with root theme as first item * * @param string $themeName * * @return Theme[] */ protected function getThemesHierarchy($themeName) { $hierarchy = []; while (null !== $themeName) { $theme = $this->themeManager->getTheme($themeName); $hierarchy[] = $theme; $themeName = $theme->getParentTheme(); } return array_reverse($hierarchy); }
/** * @param Theme $theme * @return array */ protected function collectThemeAssets(Theme $theme) { $assets = $theme->getDataByKey('assets', []); $parentTheme = $theme->getParentTheme(); if ($parentTheme) { $parentTheme = $this->themeManager->getTheme($parentTheme); $assets = array_merge_recursive($this->collectThemeAssets($parentTheme), $assets); } return $assets; }
/** * {@inheritdoc} */ public function getData(ContextInterface $context) { return $this->themeManager->getTheme($context->get('theme')); }