You are here

public function TwigExtension::getActiveTheme in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Template/TwigExtension.php \Drupal\Core\Template\TwigExtension::getActiveTheme()
  2. 9 core/lib/Drupal/Core/Template/TwigExtension.php \Drupal\Core\Template\TwigExtension::getActiveTheme()

Gets the name of the active theme.

Return value

string The name of the active theme.

File

core/lib/Drupal/Core/Template/TwigExtension.php, line 293

Class

TwigExtension
A class providing Drupal Twig extensions.

Namespace

Drupal\Core\Template

Code

public function getActiveTheme() {
  return $this->themeManager
    ->getActiveTheme()
    ->getName();
}