function Drupal::theme

Same name in other branches
  1. 8.9.x core/lib/Drupal.php \Drupal::theme()
  2. 10 core/lib/Drupal.php \Drupal::theme()
  3. 11.x core/lib/Drupal.php \Drupal::theme()

Gets the theme service.

Return value

\Drupal\Core\Theme\ThemeManagerInterface

8 calls to Drupal::theme()
RegistryLegacyTest::testMultipleSubThemes in core/tests/Drupal/KernelTests/Core/Theme/RegistryLegacyTest.php
Tests the theme registry with theme functions and multiple subthemes.
RegistryLegacyTest::testSuggestionPreprocessFunctions in core/tests/Drupal/KernelTests/Core/Theme/RegistryLegacyTest.php
Tests the theme registry with theme functions with suggestions.
RegistryTest::testMultipleSubThemes in core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
Tests the theme registry with multiple subthemes.
RegistryTest::testSuggestionPreprocessFunctions in core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
Tests the theme registry with suggestions.
RegistryTest::testThemeRegistryAlterByTheme in core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
Tests that the theme registry can be altered by themes.

... See full list

File

core/lib/Drupal.php, line 658

Class

Drupal
Static Service Container wrapper.

Code

public static function theme() {
    return static::getContainer()->get('theme.manager');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.