Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/FieldTypes/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ public function configureOptions(OptionsResolver $resolver)

public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars['html'] = $options['html'];

// Load in template as Twig\Markup object.
if (!empty($options['view'])) {
$view->vars['html'] = new Markup($options['view'], 'UTF-8');
}
$html = $options['view'] ?? $options['html'];
$view->vars['html'] = new Markup($html, 'UTF-8');
}
}
16 changes: 10 additions & 6 deletions src/Resources/views/Form/accessible-forms.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,18 @@
{# Adjust order of elements in form row, add fieldset for compound groups #}
{%- block form_row_render -%}
<div{% with {attr: row_attr} %}{{ block('attributes') }}{% endwith %}>
{% if compound %}
<fieldset class="tbxforms-fieldset" {{ block('widget_container_attributes') }}>
{% endif %}

{{- form_label(form) -}}
{{- form_help(form) -}}
{{- form_errors(form) -}}
{{- form_widget(form, widget_attr) -}}

{% if compound %}
</fieldset>
{% endif %}
</div>
{%- endblock form_row_render -%}

Expand All @@ -133,9 +141,7 @@

{# Add custom markup to checkbox / radio buttons in choice context #}
{%- block choice_widget_expanded -%}
{% if compound %}
<fieldset class="tbxforms-fieldset" {{ block('widget_container_attributes') }}>
{% else %}
{% if not compound %}
<div {{ block('widget_container_attributes') }}>
{% endif %}

Expand All @@ -148,9 +154,7 @@
{% endfor -%}
</div>

{% if compound %}
</fieldset>
{% else %}
{% if not compound %}
</div>
{% endif %}
{%- endblock choice_widget_expanded -%}
Expand Down
Loading