I often use functions that contain variables in the following files:
- Template.php
- Custom Panels Style Plugins
- node.tpl.php files
- field.tpl.php files
- views.tpl.php files
I often needed to pass variables between these functions.
At the moment, I do this by declaring my variable as a global Using PHP's global command. However, I have read that is not best practice. Is there a better way?
I know that Drupal has variable_set() and variable_get(). However, apparently these have similar problems to using Globals for lots of little variables.