How to get theme details programmatically ?
How to get the current theme ?
How to get all regions of the system ?
How to get the all the regions available in the current theme ?
How to get the libraries list of the current theme ?
How to get the base themes list of the current theme ?
Question
Get current theme.
$theme = \Drupal::theme()->getActiveTheme();
Theme name:
$theme_name = \Drupal::theme()->getActiveTheme()->getName();
Theme regions list:
$theme_regions = \Drupal::theme()->getActiveTheme()->getRegions();
Theme libraries list.
$theme_libraries = \Drupal::theme()->getActiveTheme()->getLibraries();
Theme base themes list.
$theme_basethemes = \Drupal::theme()->getActiveTheme()->getBaseThemes();
System regions list.
$theme_name = \Drupal::theme()->getActiveTheme()->getName();
$system_regions_list = system_region_list($theme_name);
Visible system regions list.
$theme_name = \Drupal::theme()->getActiveTheme()->getName();
$system_regions_list = system_region_list($theme_name, $show = REGIONS_VISIBLE);
Comments