Skip to content

Instantly share code, notes, and snippets.

@vkareh
Created Aug 6, 2012
Embed
What would you like to do?
/**
* Implements hook_theme().
*/
function HOOK_theme($existing, $type, $theme, $path) {
return array(
'h2' => array(
'variables' => array('text' => NULL, 'args' => NULL),
),
);
}
/**
* Theme H2 tags
*/
function theme_h2($variables) {
return '<h2>' . t($variables['text'], $variables['args']) . '</h2>';
}
// Call the function like this:
theme('h2', 'Summary by database for user @username', array('@username' => $databases['user']->name));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment