mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-04 18:14:55 +00:00
deprecated "if" conditions on "for" tags
This commit is contained in:
@@ -43,6 +43,8 @@ final class ForTokenParser extends AbstractTokenParser
|
||||
|
||||
$ifexpr = null;
|
||||
if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'if')) {
|
||||
@trigger_error(sprintf('Using an "if" condition on "for" tag is deprecated since Twig 2.10.0, use a "filter" filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop).', __CLASS__), E_USER_DEPRECATED);
|
||||
|
||||
$ifexpr = $this->parser->getExpressionParser()->parseExpression();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user