Hi

I am new to Drupal and have started looking at how the Zen theme is put together. I have got stuck on something which seems trivial but I still feel I need to get an explanation of how this works.

My question relates to the "$head" variable that is used in the page.tpl.php file

" print $head; "

I have found that the $head variable is declared and initialised as part of the $variables array inside phptemplate.engine. What I don't get is how it can be used in the page.tpl.php file without any reference to the $variables array. Is this a special php feature I am not aware of (very possible)? What am I missing - help!!!

Thanks
O

Comments

horuskol’s picture

This is a bit of a late response - but this behaviour is a feature of PHP - $head is declared in the global scope, and the script in page.tpl.php inherits the scope from where it is included, so it automatically has access to $head (and other variables)