function ThemeEngineInterface::renderTemplate

Renders a template.

Parameters

string $template_file: The name of the template to render, without the file extension.

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

Return value

string|\Drupal\Component\Render\MarkupInterface The output generated by the template, plus any debug information.

2 methods override ThemeEngineInterface::renderTemplate()
NyanCatThemeEngine::renderTemplate in core/modules/system/tests/modules/nyan_cat/src/NyanCatThemeEngine.php
Renders a template.
TwigThemeEngine::renderTemplate in core/lib/Drupal/Core/Template/TwigThemeEngine.php
Renders a template.

File

core/lib/Drupal/Core/Theme/ThemeEngineInterface.php, line 32

Class

ThemeEngineInterface
Defines an interface for a theme engine.

Namespace

Drupal\Core\Theme

Code

public function renderTemplate(string $template_file, array $variables) : string|MarkupInterface;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.