1 theming_example.module theming_example_theme()

Implements hook_theme().

Defines the theming capabilities provided by this module.

Related topics


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


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 template file
      // (theming-example-text-form.tpl.php) instead of being rendered by a
      // function. Note the use of dashes to separate words in place of
      // underscores. The template file's extension is also left out so that
      // it may be determined automatically depending on the template engine
      // the site is using.
      'template' => 'theming-example-text-form',