I am using $static to add the value of each row so in the end I have a sum of all rows. I would like to print this out in my views footer or in my template somewhere. How can I get the variable in $static out of my row and make it available to the rest of the view?

Comments

gthing’s picture

I found that I can load the view into the footer with this:

$view = views_get_current_view();

Now it's just a matter of pulling out the fields. The view is an enormous object and I can't really make heads or tails of it (is there some programmer trick to tracking down variable you want to use in a mess of an object like this?). As I'm looking through it, though, I'm thinking it might not be the best idea to load the entire view again once it's been loaded. So I guess the question remains - what is the best way to do this?

gthing’s picture

The best solution I've found is to load the view as above and use

$view->field[phpcode]->static;