function template_preprocess_theming_example_with_template in Examples for Developers 6
Preprocess function to modify variables before passing them to the template.
Template preprocess functions are called automatically when a template file is in use.
The pattern is template_preprocess_HOOKNAME().
For core examples, see `template_preprocess_page` and `template_preprocess_node`.
File
- theming_example/
theming_example.module, line 105 - Explains how a module declares theme functions, preprocess functions, and templates.
Code
function template_preprocess_theming_example_with_template(&$variables) {
$variables['content'] .= ' ' . t('This text was added in a preprocess function.');
$variables['aside'] = t('This is an example of a separate bit of content.');
}