Alex Rivera | Logout

preprocess Vs. process functions in drupal template

Asked 2011-05-19T21:05:27.370
15

What is the difference between

function mythemes_preprocess_html(&$variables) { ... }

and

function mythemes_process_html(&$variables) { ... }

in drupal 7 template.php.

when must use preprocess functions and when must use process functions.

thanks.

Edit
Report

1 Answer

1

More exactly, from Drupal API documentation:

If the implementation is a template file, several functions are called before the template file is invoked, to modify the $variables array. These fall into the "preprocessing" phase and the "processing" phase, and are executed (if they exist), in the following order (note that in the following list, HOOK indicates the theme hook name, MODULE indicates a module name, THEME indicates a theme name, and ENGINE indicates a theme engine name): (source: http://api.drupal.org/api/drupal/includes!theme.inc/function/theme/7)

And if you follow the link above, it will list, in order, the entire theme() progression, from process functions to preprocess functions to the template file itself.

answered 2012-11-23T23:34:53.460

Your Answer