D8 Load a twig template

Load and render a twig template
$twig = Drupal::service(‘twig’);

$template = $twig->loadTemplate(‘path/to/your_template.html.twig’);
$response = $template->render([‘var1’ => $var1, ‘var2’ => $var2]);
return $response;

var1 & var2 will also be pass as variable to twig template which we can use as follow
{{ var1 }}

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/2/feed