Timeline for Share a value between two different hooks
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 17, 2011 at 14:35 | comment | added | avpaderno♦ |
The variable that is returned by drupal_static() is local to drupal_static() , but the function returns the value of the variable by reference; this means the calling function is able to change the variable's value even if it is a static local variable for drupal_static() .
|
|
Aug 17, 2011 at 11:59 | comment | added | keithm | A static variable is local to the function but retains the value between calls. The OP wants a way to communicate between functions so this doesn't apply. drupal_static provides a method for storing static data that can be reset and manipulated from outside the defining function. | |
Aug 17, 2011 at 11:50 | comment | added | kalabro | In Drupal 7, can drupal_static() be used for this? | |
Aug 17, 2011 at 11:34 | history | answered | keithm | CC BY-SA 3.0 |