You are here

public function Twig_TokenParser_Include::parse in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/lib/Twig/TokenParser/Include.php \Twig_TokenParser_Include::parse()

Parses a token and returns a node.

Parameters

Twig_Token $token A Twig_Token instance:

Return value

Twig_NodeInterface A Twig_NodeInterface instance

Throws

Twig_Error_Syntax

Overrides Twig_TokenParserInterface::parse

1 method overrides Twig_TokenParser_Include::parse()
Twig_TokenParser_Embed::parse in vendor/twig/twig/lib/Twig/TokenParser/Embed.php
Parses a token and returns a node.

File

vendor/twig/twig/lib/Twig/TokenParser/Include.php, line 24

Class

Twig_TokenParser_Include
Includes a template.

Code

public function parse(Twig_Token $token) {
  $expr = $this->parser
    ->getExpressionParser()
    ->parseExpression();
  list($variables, $only, $ignoreMissing) = $this
    ->parseArguments();
  return new Twig_Node_Include($expr, $variables, $only, $ignoreMissing, $token
    ->getLine(), $this
    ->getTag());
}