function ModuleHandler::invoke

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::invoke()
  2. 10 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::invoke()
  3. 11.x core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::invoke()

Overrides ModuleHandlerInterface::invoke

1 call to ModuleHandler::invoke()
ModuleHandler::invokeDeprecated in core/lib/Drupal/Core/Extension/ModuleHandler.php
Invokes a deprecated hook in a particular module.

File

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

Class

ModuleHandler
Class that manages modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

public function invoke($module, $hook, array $args = []) {
    if (!$this->implementsHook($module, $hook)) {
        return;
    }
    $function = $module . '_' . $hook;
    return call_user_func_array($function, $args);
}

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