Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Environment.php

function Environment::render

Renders a template.

Parameters

string|TemplateWrapper $name The template name:

Throws

LoaderError When the template cannot be found

SyntaxError When an error occurred during compilation

RuntimeError When an error occurred during rendering

File

vendor/twig/twig/src/Environment.php, line 318

Class

Environment
Stores the Twig configuration and renders templates.

Namespace

Twig

Code

public function render($name, array $context = []) : string {
    return $this->load($name)
        ->render($context);
}
RSS feed
Powered by Drupal