Вы находитесь на странице: 1из 1

theme function call for Drupal 6.

x
theme('hook', $arguments) http://api.drupal.org/api/function/theme/6

[ load theme registry ]


[ check hook for *wild cards ]

if hook is function

f.a themeName_hook($arguments) template.php


or
f.b engineName_hook($arguments) .engine

f.c theme_hook($arguments) .module/.inc


[ default implementation as function ]

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
template_preprocess theme.inc
t.a
[ set variables & suggestions ] template_preprocess_hook .module/.inc

moduleName_preprocess .module
All variables passed by reference moduleName_preprocess_hook t.b
between each preprocess function.
As a result, variables are additive engineName_engine_preprocess .engine
building the variables array.
engineName_engine_preprocess_hook t.c

engineName_preprocess template.php
engineName_preprocess_hook t.d
themeName_preprocess
themeName_preprocess_hook

[ collect suggestions ]

drupal_discover_template
[ find implemented suggestion ]

theme_render_template

[ assemble .tpl.php file ]

suggestion default hook

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

Вам также может понравиться