[eluser]zauber[/eluser]
It appears that one can not use global variables in functions in views. See this example:
Code:
testview.php
---------------------------
<html><body>
<?
function printvar(){
global $tree;
if (isset($tree)) echo "1";
else echo "0";
}
if (isset($tree)) echo "1";
else echo "0";
printvar();
?>
</body></html>
This outputs "10", ie: outside the function, the variable "tree" is set (passed from the controller), but inside the function the variable is NOT set, despite using "global".
Why don't globals work in functions in views? Are there any other "hidden" ways in which views are not just plain, normal php scripts?