Skip to content

Commit ae6ae33

Browse files
BooleanTypejaviereguiluz
BooleanType
authored andcommitted
Adding an if condition on a for tag is deprecated in Twig 2.10.
I've got an error, running example from the docs. Here is the explanation: https://twig.symfony.com/doc/2.x/deprecated.html#tags I propose to use a filter filter or an “if” condition inside the “for” body instead in this docs.
1 parent 811df86 commit ae6ae33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

form/create_custom_field_type.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ libraries are used in your application:
405405

406406
{# templates/form/custom_types.html.twig #}
407407
{% block postal_address_row %}
408-
{% for child in form.children if not child.rendered %}
408+
{% for child in form.children|filter(v => not v.rendered) -%}
409409
<div class="form-group">
410410
{{ form_label(child) }}
411411
{{ form_widget(child) }}

0 commit comments

Comments
 (0)