You are here

function theming_example_theme in Examples for Developers 6

Same name and namespace in other branches
  1. 7 theming_example/theming_example.module \theming_example_theme()
  2. 3.x modules/theming_example/theming_example.module \theming_example_theme()

Implements hook_theme().

Defines the theming capabilities provided by this module.

See also

http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hoo...

File

theming_example/theming_example.module, line 44
Explains how a module declares theme functions, preprocess functions, and templates.

Code

function theming_example_theme() {
  return array(
    'theming_example_basic_content' => array(
      // arguments = required key.
      'arguments' => array(
        'content' => NULL,
      ),
    ),
    // When declaring a template file, a corresponding preprocess function
    // is also automatically assigned. More preprocess functions can be
    // added, by using the 'preprocess functions' element, commented out
    // in this example.
    'theming_example_with_template' => array(
      'arguments' => array(
        'content' => NULL,
      ),
      'template' => 'theming_example_with_template',
    ),
  );
}