Skip to main content

Pass by reference trong module_invoke

· One min read
Tien

Unfortunately module_invoke_all() and module_invoke() do not allow passing variables by reference.

To work around this, you can do something like this:

<?php foreach (module_implements('my_hook') as $module) {
$function = $module . '_my_hook';
$function($var1, $var2);
}
?>