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

Breadcrumb

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

function Environment::parse

Converts a token stream to a node tree.

Throws

SyntaxError When the token stream is syntactically or semantically wrong

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

File

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

Class

Environment
Stores the Twig configuration and renders templates.

Namespace

Twig

Code

public function parse(TokenStream $stream) : ModuleNode {
    if (null === $this->parser) {
        $this->parser = new Parser($this);
    }
    return $this->parser
        ->parse($stream);
}
RSS feed
Powered by Drupal