theming_example_theme

  1. drupal
    1. 7 theming_example.module function
Drupal 7 theming_example_theme()

Implements hook_theme().

Defines the theming capabilities provided by this module.

File

sites/all/modules/examples/theming_example/theming_example.module, line 59
Explains how a module declares theme functions, preprocess functions, and templates.

Code

function theming_example_theme() {
  return array(
    'theming_example_content_array' => array(
      // We use 'render element' when the item to be passed is a self-describing
      // render array (it will have #theme_wrappers)
      'render element' => 'element',
    ), 
    'theming_example_list' => array(
      // We use 'variables' when the item to be passed is an array whose
      // structure must be described here.
      'variables' => array(
        'title' => NULL, 
        'items' => NULL,
      ),
    ), 
    'theming_example_select_form' => array(
      'render element' => 'form',
    ), 
    'theming_example_text_form' => array(
      'render element' => 'form',
      // In this one the rendering will be done by a tpl.php file instead of
      // being rendered by a function, so we specify a template. 
      'template' => 'theming_example_text_form',
    ),
  );
}