I often use functions that contain variables in the following files:
- 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?