I had some similar questions here, but would like ultimately to know best practices and possibilities for this case.
I have my custom module, in which I use two contrib modules hooks. As I understood, hooks are self-invoked (looking from my module point of view), and as soon as I am declaring it, they get executed.
That said, how I can get return of an hook function ?
I am trying to make $foo1 available in other hook and vice versa for $hook2. I would like to avoid oop solutions if possible.
Example:
function mymodule_contribmodulehook1 ($parameter1, $parameter2) {
//$foo2 here somehow ?
$foo1 = 1;
return $foo1;
}
function mymodule_contribmodulehook2 ($parameter1, $parameter2) {
//$foo1 here somehow ?
$foo2 = 1;
return $foo2;
}
return
statement in a function?