4.6.x theme.inc theme()
4.7.x theme.inc theme()
5.x theme.inc theme()
6.x theme.inc theme()
7.x theme.inc theme($hook, $variables = array())

Generate the themed representation of a Drupal object.

All requests for themed functions must go through this function. It examines the request and routes it to the appropriate theme function. If the current theme does not implement the requested function, then the current theme engine is checked. If neither the engine nor theme implement the requested function, then the base theme function is called.

For example, to retrieve the HTML that is output by theme_page($output), a module should call theme('page', $output).


$function: The name of the theme function to call.

...: Additional arguments to pass along to the theme function.

Return value

An HTML string that generates the themed output.

278 calls to theme()
aggregator_admin_remove_feed in modules/aggregator.module
aggregator_block in modules/aggregator.module
Implementation of hook_block().
aggregator_form_category_submit in modules/aggregator.module
Process aggregator_form_category form submissions. @todo Add delete confirmation dialog.
aggregator_form_category_validate in modules/aggregator.module
Validate aggregator_form_feed form submissions.
aggregator_form_feed_submit in modules/aggregator.module
Process aggregator_form_feed form submissions. @todo Add delete confirmation dialog.

... See full list

9 string references to 'theme'
block_admin_display in modules/block.module
Generate main block administration form.
block_admin_display_submit in modules/block.module
Process main block administration form submission.
system_theme_data in modules/system.module
Collect data about all currently available themes
system_theme_select_form in modules/system.module
Returns a fieldset containing the theme select form.
system_update_145 in database/updates.inc

... See full list


includes/theme.inc, line 160
The theme system, which controls the output of Drupal.


function theme() {
  $args = func_get_args();
  $function = array_shift($args);

  if ($func = theme_get_function($function)) {
    return call_user_func_array($func, $args);