diff --git a/core/themes/engines/twig/twig.engine b/core/themes/engines/twig/twig.engine index d98f021..d318263 100644 --- a/core/themes/engines/twig/twig.engine +++ b/core/themes/engines/twig/twig.engine @@ -31,49 +31,22 @@ function twig_init($template) { } /** - * Renders a Twig template. + * Render twig templates. * - * This retrieves Twig_Environment from the container and renders the template. - * - * If Twig debug settings are enabled, HTML comments including file name - * suggestions will surround the template markup. + * This retrieves the Twig_Environment from the Drupal Injection container and + * renders the template. * * @param $template_file - * The file name of the template to render. + * The filename of the template to render. * @param $variables * A keyed array of variables that will appear in the output. * * @return - * The output generated by the template, plus any debug information. + * The output generated by the template. */ function twig_render_template($template_file, $variables) { $variables['_references'] = array(); - $output = array( - 'debug_prefix' => '', - 'debug_info' => '', - 'rendered_markup' => drupal_container()->get('twig')->loadTemplate($template_file)->render($variables), - 'debug_suffix' => '', - ); - if (settings()->get('twig_debug', FALSE)) { - $output['debug_prefix'] .= "\n\n"; - $output['debug_prefix'] .= "\n"; - if (!empty($variables['theme_hook_suggestions'])) { - $extension = twig_extension(); - $current_template = explode('/', $template_file); - $current_template = array_pop($current_template); - $suggestions = $variables['theme_hook_suggestions']; - $suggestions[] = $variables['theme_hook_original']; - foreach ($suggestions as $key => &$suggestion) { - $template = $suggestion . $extension; - $prefix = ($template == $current_template) ? 'x' : '*'; - $suggestion = $prefix . ' ' . str_replace('_', '-', $template); - } - $output['debug_info'] .= "\n"; - } - $output['debug_info'] .= "\n\n"; - $output['debug_suffix'] .= "\n\n\n"; - } - return implode('', $output); + return drupal_container()->get('twig')->loadTemplate($template_file)->render($variables); } /**