1 theme.inc theme_render_template($template_file, $variables)

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


$template_file: The filename of the template to render.

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

Return value

string: The output generated by the template.


core/includes/theme.inc, line 1551
The theme system, which controls the output of Backdrop.


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

  // Start output buffering

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

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