You are on page 1of 1

theme('hook', $arguments)

[ load theme registry ] [ check hook for *wild cards ]

theme function call for Drupal 6.x http://api.drupal.org/api/function/theme/6

if hook is function
f.a themeName_hook($arguments) or f.b engineName_hook($arguments) f.c theme_hook($arguments) [ default implementation as function ] .engine .module/.inc template.php

else hook is template


[ convert $arguments into variables ] [ check for render function, defaults to theme_render_template ] [ check for extension function and run, defaults to ".tpl.php" ] preprocess functions [ set variables & suggestions ] template_preprocess template_preprocess_hook moduleName_preprocess
All variables passed by reference between each preprocess function. As a result, variables are additive building the variables array.

theme.inc .module/.inc .module

t.a

moduleName_preprocess_hook engineName_engine_preprocess engineName_engine_preprocess_hook engineName_preprocess engineName_preprocess_hook themeName_preprocess themeName_preprocess_hook [ collect suggestions ] drupal_discover_template [ nd implemented suggestion ] theme_render_template .engine

t.b

t.c template.php t.d

[ assemble .tpl.php le ]
suggestion default hook

suggestion.tpl.php <html> <?php print $variable ?> </html>

hook.tpl.php <html> <?php print $variable ?> </html>

You might also like