37 $stream = $this->parser->getStream();
42 $expr = $this->parser->getExpressionParser()->parseExpression();
46 $value = $expr->getAttribute(
'value');
48 $compat =
true === $value ||
false === $value;
50 if (
true === $value) {
55 @trigger_error(
'Using the autoescape tag with "true" or "false" before the strategy name is deprecated since version 1.21.', E_USER_DEPRECATED);
57 if (
false === $value) {
58 throw new Twig_Error_Syntax(
'Unexpected escaping strategy as you set autoescaping to false.',
$stream->getCurrent()->getLine(),
$stream->getSourceContext());
61 $value =
$stream->next()->getValue();
66 $body = $this->parser->subparse(
array($this,
'decideBlockEnd'),
true);
74 return $token->
test(
'endautoescape');
83 class_alias(
'Twig_TokenParser_AutoEscape',
'Twig\TokenParser\AutoEscapeTokenParser',
false);
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.
$stream
PHP stream implementation.
Exception thrown when a syntax error occurs during lexing or parsing of a template.
decideBlockEnd(Twig_Token $token)
Base class for all token parsers.
parse(Twig_Token $token)
Parses a token and returns a node.
Create styles array
The data for the language used.
Marks a section of a template to be escaped or not.