function Drupal::moduleHandler

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

Returns the module handler.

Return value

\Drupal\Core\Extension\ModuleHandlerInterface

49 calls to Drupal::moduleHandler()
CategorizingPluginManagerTrait::getModuleHandler in core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php
Returns the module handler used.
ckeditor5_library_info_alter in core/modules/ckeditor5/ckeditor5.module
Implements hook_library_info_alter().
ContextualLinks::moduleHandler in core/modules/contextual/src/Element/ContextualLinks.php
Wraps the module handler.
DefaultMenuLinkTreeManipulators::__construct in core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php
Constructs a \Drupal\Core\Menu\DefaultMenuLinkTreeManipulators object.
DrupalTest::testModuleHandler in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the moduleHandler() method.

... See full list

File

core/lib/Drupal.php, line 542

Class

Drupal
Static Service Container wrapper.

Code

public static function moduleHandler() {
    return static::getContainer()->get('module_handler');
}

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