Tuesday, 3 July 2012

What is hook_preprocess() in Drupal?

Syn: hook_preprocess(&$variables, $hook)

hook_preprocess used to Preprocess theme variables for template files.

This hook allows modules to preprocess theme variables for theme templates. It is only called for theme hooks implemented as template files, but not for those implemented as theme functions. The purpose of this hook is to allow modules to add to or override variables for all template files.

Parameters:

$variables: The variables array (modify in place).
$hook: The name of the theme hook.

No comments:

Post a Comment

Thank you so much for providing your valuable feedback. I will will look into them and update my skills & technologies accordingly.