Skip to content

form_row block override in form theme does not work for checkbox #515

Closed
@emodric

Description

@emodric

I tried adding an override for form_row block in app/Resources/views/form/layout.html.twig:

{% block form_row %}
    MY OVERRIDE START

    <div>
        {{- form_label(form) -}}
        {{- form_widget(form) -}}
        {{- form_errors(form) -}}
    </div>

    MY OVERRIDE END
{% endblock %}

I also added a boolean property to one of the entities (for example Post), and corresponding checkbox field to PostType.

It turns out that form_row block override is not applied to Checkbox form type, and I couldn't find the reason why.

This is not an issue in Symfony nor an issue with version of PHP. I tested on PHP 5.6, PHP 7.1 and both show this behaviour. I also tested on Sylius (with Symfony 3.2) and it works okay there, so I think it is related to something in this demo.

If this is intended, how do I make the checkbox form type use my form_row override?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions