Skip to content

Instantly share code, notes, and snippets.

@mrded
Last active December 25, 2015 19:29
Show Gist options
  • Save mrded/7027592 to your computer and use it in GitHub Desktop.
Save mrded/7027592 to your computer and use it in GitHub Desktop.
Drupal: example of hook invoking
<?php
$baz = $qux = t('Arguments');
$bar = array();
foreach (module_implements('foo') as $module) {
$bar[] = module_invoke($module, 'foo', $baz, $qux);
}
# module_invoke_all('foo', $baz, $qux);
function hook_foo($baz, $qux) {
return t('It works!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment