Created
April 3, 2012 09:08
-
-
Save mguillermin/2290579 to your computer and use it in GitHub Desktop.
Exemple de hook_module_implements_alter() dans Drupal 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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