function theme_render_template

Same name and namespace in other branches
  1. 6.x drupal-6.x/includes/theme.inc \theme_render_template()

Renders a system default template, which is essentially a PHP template.

Parameters

$template_file: The filename of the template to render.

$variables: A keyed array of variables that will appear in the output.

Return value

The output generated by the template.

1 string reference to 'theme_render_template'
theme in drupal-7.x/includes/theme.inc
Generates themed output.

Archivo

drupal-7.x/includes/theme.inc, line 1509
The theme system, which controls the output of Drupal.

Código

function theme_render_template($template_file, $variables) {
  // Extract the variables to a local namespace
  extract($variables, EXTR_SKIP);

  // Start output buffering
  ob_start();

  // Include the template file
  include DRUPAL_ROOT . '/' . $template_file;

  // End buffering and return its contents
  return ob_get_clean();
}