Skip to content

Instantly share code, notes, and snippets.

@mguillermin
Created April 3, 2012 09:08
Show Gist options
  • Save mguillermin/2290579 to your computer and use it in GitHub Desktop.
Save mguillermin/2290579 to your computer and use it in GitHub Desktop.
Exemple de hook_module_implements_alter() dans Drupal 7
<?php
function my_module_module_implements_alter(&$implementations, $hook) {
switch ($hook) {
case 'form_alter':
if (array_key_exists('my_module', $implementations)) {
// On veut que le hook_form_alter my_module soit le dernier exécuté
// On le remet à la fin du tableau
$my_module = $implementations['my_module'];
unset($implementations['my_module']);
$implementations['my_module'] = $my_module;
}
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment