No, since I'm including a file based on the parameter to the function, I really don't know which variables I will need. This is also the reason I can't pass these values into the function "the normal way".
Maybe there's a better way to do what I want to do. My function is called element(), which works similar to CakePHP's element include function, and simply includes a view template file based on the argument to the function. The view template files can use a wide range of global variables.
Thank you for your help.