37 $template = $this->parser->getExpressionParser()->parseExpression();
38 $stream = $this->parser->getStream();
41 throw new Twig_Error_Syntax(
'The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getFilename());
45 if ($stream->test(
'with')) {
52 if ($stream->test(
'as')) {
58 $targets[$name] =
new Twig_Node_Expression_Constant($alias, -1);
70 $this->parser->addTrait(
new Twig_Node(array(
'template' => $template,
'targets' =>
new Twig_Node($targets))));
Base class for all token parsers.
getTag()
Gets the tag name associated with this token parser.
Represents a node in the AST.
Exception thrown when a syntax error occurs during lexing or parsing of a template.
parse(Twig_Token $token)
Parses a token and returns a node.
Imports blocks defined in another template into the current template.