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

Breadcrumb

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

function Environment::compile

Compiles a node and returns the PHP code.

1 call to Environment::compile()
Environment::compileSource in vendor/twig/twig/src/Environment.php
Compiles a template source code.

File

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

Class

Environment
Stores the Twig configuration and renders templates.

Namespace

Twig

Code

public function compile(Node $node) : string {
    if (null === $this->compiler) {
        $this->compiler = new Compiler($this);
    }
    return $this->compiler
        ->compile($node)
        ->getSource();
}
RSS feed
Powered by Drupal