Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ModuleHandler.php

function ModuleHandler::invokeAllWith

Overrides ModuleHandlerInterface::invokeAllWith

1 call to ModuleHandler::invokeAllWith()
ModuleHandler::invokeAll in core/lib/Drupal/Core/Extension/ModuleHandler.php
Invokes a hook in all enabled modules that implement it.

File

core/lib/Drupal/Core/Extension/ModuleHandler.php, line 304

Class

ModuleHandler
Class that manages modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

public function invokeAllWith(string $hook, callable $callback) : void {
    foreach ($this->getHookListeners($hook) as $module => $listeners) {
        foreach ($listeners as $listener) {
            $callback($listener, $module);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal