In my custom theme's hook_preprocess_page()
and hook_preprocess_html()
functions, I often need to identify the same information. Rather than essentially running the same if statement checks in both the identify the same info, it would make much more sense to just do it once in both of them and then pass that info to the other preprocess function. How can I do this? I tried the following but it didn't work:
function myTheme_preprocess_page(&$vars){
$vars['myValue'] = 7;
}
function myTheme_preprocess_html(&$vars){
//$vars['myValue'] should equal 7...
}
I also tried it the other way around (setting the value in the preprocess html function and then retrieving it in the page preprocess function) but that didn't work either. Which brings up a related question: in what order are these preprocess functions, er, processed? It seems to me that the page preprocess function comes before the html one, is that correct?