function theming_example_theme

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

Implements hook_theme().

Defines the theming capabilities provided by this module.

Related topics

File

modules/theming_example/theming_example.module, line 113

Code

function theming_example_theme($existing, $type, $theme, $path) {
  return [
    'theming_example_content_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' => [
      // We use 'variables' when the item to be passed is an array whose
      // structure must be described here.
'variables' => [
        'title' => NULL,
        'items' => NULL,
      ],
    ],
    'theming_example_text_form' => [
      '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',
    ],
  ];
}