Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal.php \Drupal::theme()
  2. 9 core/lib/Drupal.php \Drupal::theme()

Gets the theme service.

Return value

\Drupal\Core\Theme\ThemeManagerInterface

33 calls to Drupal::theme()
AjaxTestController::theme in core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php
Returns the used theme.
AlterTest::testDrupalAlter in core/modules/system/tests/src/Kernel/Common/AlterTest.php
Tests if the theme has been altered.
AssertContentTrait::assertThemeOutput in core/tests/Drupal/KernelTests/AssertContentTrait.php
Asserts themed output.
batch_process in core/includes/form.inc
Processes the batch.
block_page_top in core/modules/block/block.module
Implements hook_page_top().

... See full list

File

core/lib/Drupal.php, line 651

Class

Drupal
Static Service Container wrapper.

Code

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