function Drupal::moduleHandler

Same name in other branches
  1. 9 core/lib/Drupal.php \Drupal::moduleHandler()
  2. 10 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

42 calls to Drupal::moduleHandler()
CategorizingPluginManagerTrait::getModuleHandler in core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php
Returns the module handler used.
comment_post_update_enable_comment_admin_view in core/modules/comment/comment.post_update.php
Enable the comment admin view.
content_moderation_requirements in core/modules/content_moderation/content_moderation.install
Implements hook_requirements().
ContextualLinks::moduleHandler in core/modules/contextual/src/Element/ContextualLinks.php
Wraps the module handler.
dblog_post_update_convert_recent_messages_to_view in core/modules/dblog/dblog.post_update.php
Replace 'Recent log messages' with a view.

... See full list

File

core/lib/Drupal.php, line 517

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.