| 6 core.php | hook_preprocess(&$variables, $hook) |
| 7 theme.api.php | hook_preprocess(&$variables, $hook) |
| 8 theme.api.php | hook_preprocess(&$variables, $hook) |
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.
For more detailed information, see theme().
Parameters
$variables: The variables array (modify in place).
$hook: The name of the theme hook.
Related topics
3 functions implement hook_preprocess()
File
- developer/
hooks/ core.php, line 2277 - These are the hooks that are invoked by the Drupal core.
Code
function hook_preprocess(&$variables, $hook) {
// Add the name of the current theme hook as a variable
$variables['theme_hook'] = $hook;
}
Login or register to post comments