mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
parent
ce314899a8
commit
aa16bdcbb9
@ -19,7 +19,7 @@ class ChoiceWithOtherType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
//add an 'other' entry in choices array
|
||||
$options['choices']['_other'] = '__other__';
|
||||
$options['choices']['_other'] = 'Other value';
|
||||
//ChoiceWithOther must always be expanded
|
||||
$options['expanded'] = true;
|
||||
|
||||
|
@ -95,13 +95,11 @@ jQuery(document).ready(initialize_{{ form.vars.id }}('ul_' + '{{ form.vars.id }}
|
||||
|
||||
{% block choice_with_other_widget %}
|
||||
<div {{ block('widget_container_attributes') }}>
|
||||
|
||||
{%- for child in form.children._choices %}
|
||||
{%- if child.vars.value == '_other' -%}
|
||||
{{- form_widget(child) -}} {{- form_widget(form.children._other) -}}
|
||||
{%- else -%}
|
||||
{{- form_widget(child) -}}
|
||||
{{- form_label(child) -}}
|
||||
{%- if child.vars.value == '_other' -%}
|
||||
{{- form_widget(form.children._other) -}}
|
||||
{%- endif -%}
|
||||
{% endfor -%}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user