preprocess Vs. process functions in drupal template

Questioner picture Questioner · May 19, 2011 · Viewed 7.5k times · Source

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.

Answer

user491844 picture user491844 · Jul 18, 2011

They're effectively the same thing albeit called in different phases. Preprocess functions are called first and changes are made. Process functions are then called at a later phase and allow for changes to be made to alter any modifications introduced during the preprocess phase.

See http://drupal.org/node/223430 for more information.