Skip to content

Instantly share code, notes, and snippets.

@vkareh
Created August 6, 2012 18:53
Show Gist options
  • Save vkareh/3277520 to your computer and use it in GitHub Desktop.
Save vkareh/3277520 to your computer and use it in GitHub Desktop.
/**
* 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