Skip to content
Open
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
26 changes: 12 additions & 14 deletions Resources/views/Form/fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,16 @@
{% set attr = attr|merge({'data-classtype': class_type}) %}
{% endif %}

{% apply spaceless %}
<select {{ block('widget_attributes') }}>
{% if value is iterable %}
{% if allow_clear %}
<option value=""></option>
{% endif %}
{% for id, label in value %}
{% block tetranz_select2entity_widget_select_option %}
<option value="{{ id }}" selected="selected">{{ label }}</option>
{% endblock %}
{% endfor %}
{% endif %}
</select>
{% endapply %}
<select {{ block('widget_attributes') }}>
{% if value is iterable %}
{% if allow_clear %}
<option value=""></option>
{% endif %}
{% for id, label in value %}
{% block tetranz_select2entity_widget_select_option %}
<option value="{{ id }}" selected="selected">{{ label }}</option>
{% endblock %}
{% endfor %}
{% endif %}
</select>
{% endblock %}
2 changes: 1 addition & 1 deletion src/DependencyInjection/TetranzSelect2EntityExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Tetranz\Select2EntityBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

/**
Expand Down