I am having trouble overriding a checkbox field in my Symfony form inside my Twig template.
I am building the field with the following code in my Twig template:
{{ form_row(form.legal, {
'label' : 'personal.form.fields.legal'|trans,
}) }}
In the same template I have the following block where I am attempting to customise the label. Note the translation above includes HTML which is why I need the raw
filter.
{% block _crmpiccobundle_details_legal_label %}
{% apply spaceless %}
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
{{ label|unescape|raw }}
</label>
{% endapply %}
{%- endblock %}
Unfortunately, this doesn't work and bizarrely leaves me with no checkbox and a duplicate label and I can't work out why.