1 minute
Get current theme.
1.$theme = \Drupal::theme()->getActiveTheme();
2.$theme = \Drupal::service('theme.manager')->getActiveTheme();
3.$theme = \Drupal::config('system.theme')->get('default');
获取后台主题名称
$admin_theme = \Drupal::config('system.theme')->get('admin');
修改主题
// Set the default theme.
\Drupal::config('system.theme')
->set('default', $theme)
->save();
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);
drush设置后台主题
drush config-set system.theme admin seven -y
- Log in to post comments
Comments
NULLAM ID DOLOR ID NIBH ULTRICIES VEHICULA UT ID
Donec sed odio dui. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.
NULLA VITAE ELIT LIBERO, A PHARETRA AUGUE
Donec sed odio dui. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.
LOREM IPSUM DOLOR SIT AMET
Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nullam id dolor id nibh ultricies vehicula ut id elit.