{% block medias_row %} {% if prototype is defined and not prototype.rendered %} {% set row_attr = row_attr|merge({ 'data-prototype': form_row(prototype) }) %} {% endif %} {% set row_attr = row_attr|merge({ 'data-ea-collection-field': 'true', 'data-entry-is-complex': form.vars.ea_crud_form.ea_field and form.vars.ea_crud_form.ea_field.customOptions.get('entryIsComplex') ? 'true' : 'false', 'data-allow-add': allow_add ? 'true' : 'false', 'data-allow-delete': allow_delete ? 'true' : 'false', 'data-num-items': form.children is empty ? 0 : max(form.children|keys), 'data-form-type-name-placeholder': prototype is defined ? prototype.vars.name : '', }) %} {{ block('form_row') }} {% endblock medias_row %} {% block medias_widget %} {# the "is iterable" check is needed because if an object implements __toString() and returns an empty string, "is empty" returns true even if it's not a collection #} {% set isEmptyCollection = value is null or (value is iterable and value is empty) %} {% set is_array_field = 'EasyCorp\\Bundle\\EasyAdminBundle\\Field\\ArrayField' == form.vars.ea_crud_form.ea_field.fieldFqcn ?? false %}