Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Twig 2.10 Deprecation Update to swiftmailer.html.twig, without filter #284

Closed
wants to merge 1 commit into from

Conversation

KrisCarr
Copy link
Contributor

This change addresses the following Twig deprecation:

Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop). https://twig.symfony.com/doc/2.x/deprecated.html

This solution uses a separate "if" block instead of a "filter". This is due to "filter" requiring Twig 1.41 or higher. (https://twig.symfony.com/doc/2.x/filters/filter.html)

A solution that does use "filter" can be found at #282

This change addresses the following Twig deprecation:

Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop). https://twig.symfony.com/doc/2.x/deprecated.html

This solution uses a separate "if" block instead of a "filter" which requires Twig 1.41 or higher. (https://twig.symfony.com/doc/2.x/filters/filter.html)

A solution that does use "filter" can be found at symfony#282
@fabpot
Copy link
Member

fabpot commented May 11, 2019

closing in favor of #282

@fabpot fabpot closed this May 11, 2019
fabpot added a commit that referenced this pull request May 11, 2019
…arr)

This PR was merged into the 3.2-dev branch.

Discussion
----------

Twig 2.10 Deprecation Update to swiftmailer.html.twig

This change addresses the following Twig deprecation:

> Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop). https://twig.symfony.com/doc/2.x/deprecated.html

This solution uses the "filter" filter to maintain the single-tag "for" previously in place over adding a separate "if" tag. This requires Twig 1.41 or higher. (https://twig.symfony.com/doc/2.x/filters/filter.html)

A solution that does not use "filter" can be found at #284

Commits
-------

ad98ef1 Update swiftmailer.html.twig
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants