You are here

public function Drupal7::module_invoke in Service Container 7.2

Same name and namespace in other branches
  1. 7 src/Legacy/Drupal7.php \Drupal\service_container\Legacy\Drupal7::module_invoke()

Invokes a hook in a particular module.

All arguments are passed by value. Use drupal_alter() if you need to pass arguments by reference.

Parameters

$module: The name of the module (without the .module extension).

$hook: The name of the hook to invoke.

...: Arguments to pass to the hook implementation.

Return value

mixed The return value of the hook implementation.

See also

drupal_alter()

File

src/Legacy/Drupal7.php, line 295
Contains \Drupal\service_container\Legacy\Drupal7.

Class

Drupal7
Defines the Drupal 7 legacy service.

Namespace

Drupal\service_container\Legacy

Code

public function module_invoke($module, $hook) {
  $args = func_get_args();

  // Remove $module and $hook from the arguments.
  unset($args[0], $args[1]);
  return module_invoke($module, $hook, $args);
}