function _bootstrap_get_base_themes in Express 8
Returns a list of base themes for active or provided theme.
// Before (including active theme).
$base_themes = _bootstrap_get_base_themes(NULL, TRUE);
// Before (excluding active theme).
$base_themes = _bootstrap_get_base_themes('my_subtheme');
// After (including active theme).
use Drupal\bootstrap\Bootstrap;
$theme = Bootstrap::getTheme();
$base_themes = array_keys($theme
->getAncestry());
// After (excluding active theme).
use Drupal\bootstrap\Bootstrap;
$my_subtheme = Bootstrap::getTheme('my_subtheme');
$base_themes = array_keys($my_subtheme
->getAncestry());
array_pop($base_themes);
Parameters
string $theme_key: The machine name of the theme to check, if not set the active theme name will be used.
bool $include_theme_key: Whether to append the returned list with $theme_key.
Return value
array An indexed array of base themes.
Deprecated
Will be removed in a future release.
See also
\Drupal\bootstrap\Theme::getAncestry()
File
- themes/
contrib/ bootstrap/ deprecated.php, line 303 - This contains deprecated functions that will be removed in a future release.
Code
function _bootstrap_get_base_themes($theme_key = NULL, $include_theme_key = FALSE) {
Bootstrap::deprecated();
$themes = array_keys(Bootstrap::getTheme($theme_key)
->getAncestry());
if (!$include_theme_key) {
array_pop($themes);
}
return $themes;
}