I\'m trying to put html inside a form button with twig like:
{{ form_widget(form.jiraStatus, {
\'label\': \'Bug\',
If you're looking for a simpler solution, just insert this into your form theme:
{%- block button_widget -%}
{% set attr = attr|merge({class: (attr.class|default('btn-default') ~ ' btn')|trim}) %}
{%- if label is empty -%}
{%- if label_format is not empty -%}
{% set label = label_format|replace({
'%name%': name,
'%id%': id,
}) %}
{%- else -%}
{% set label = name|humanize %}
{%- endif -%}
{%- endif -%}
{%- endblock button_widget -%}
You can then go ahead and insert HTML in your button label:
{{ form_widget(searchForm.search, {'label': ''}) }}