Change record status: 
Project: 
Introduced in branch: 
8.0.x
Introduced in version: 
8.0.0-alpha14
Description: 

In Drupal 7 and below, the PHPTemplate rendering engine allowed you to render arbitrary PHP template files (e.g. mytemplate.tpl.php) to a string of markup using the theme_render_template() function. This function is useful when generating markup programmatically or templating files which aren't meant to be rendered to a full HTML page response.

In Drupal 8, when the default theme system was changed to Twig, the theme_render_template() function was replaced by twig_render_template(), which substantially does the same thing.

Before (Drupal 7 and below):

$output = theme_render_template(drupal_get_path('module', 'my_module') . '/templates/my-template.tpl.php', array(
  'my-variable' => 'value',
));

After (Drupal 8):

$markup = twig_render_template(drupal_get_path('module', 'my_module') . '/templates/my-template.html.twig', array(
  'my-variable' => 'value',
));
$output = (string) $markup;
Impacts: 
Module developers
Themers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done