42 $stream = $this->parser->getStream();
47 $expr = $this->parser->getExpressionParser()->parseExpression();
49 throw new Twig_Error_Syntax(
'An escaping strategy must be a string or a Boolean.', $stream->getCurrent()->getLine(), $stream->getFilename());
51 $value = $expr->getAttribute(
'value');
53 $compat =
true === $value ||
false === $value;
55 if (
true === $value) {
60 if (
false === $value) {
61 throw new Twig_Error_Syntax(
'Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getFilename());
64 $value = $stream->next()->getValue();
69 $body = $this->parser->subparse(array($this,
'decideBlockEnd'),
true);
77 return $token->
test(
'endautoescape');
Base class for all token parsers.
decideBlockEnd(Twig_Token $token)
Exception thrown when a syntax error occurs during lexing or parsing of a template.
Marks a section of a template to be escaped or not.
Represents an autoescape node.
getTag()
Gets the tag name associated with this token parser.
test($type, $values=null)
Tests the current token for a type and/or a value.
parse(Twig_Token $token)
Parses a token and returns a node.