Symfony 3 update roles user with form
<p>I need some help, I would make a form to change the roles of users in the app. </p>

<p>I'm using the "default" bundle security of Symfony 3.1.X.</p>

<p>Actually I can retrieve all the roles in the DB and display them, I also make some treatment on the data, but I still stuck on a display problem, when I display the form, the Twig bundle continues to display some label that already display below.</p>

<p>How can I fix this ? </p>

<p>Here's my code : </p>

<p><kbd>display template</kbd></p>

<pre><code>    {% extends 'admin/base.admin.html.twig' %}

   {% block body %}
    &lt;section class="container"&gt;
        {{ user.pseudo }} | 

        {{ dump(user, form.roles) }}
        {{ form_start(form) }}
        {% for role in user.roles %}
            {% if form.roles.children[role] is defined %}
                {{ form_label(form.roles.children[role]) }}
                {{ form_widget(form.roles.children[role], {'attr':{'checked':true}}) }}
            {% else %}
                {{ form_label(form.roles) }}
                {{ form_widget(form.roles) }}
            {% endif %}
        {% endfor %}
        {{ form_end(form) }}
    &lt;/section&gt;

    &lt;div class="well"&gt;
        {% for key, role in form.roles.children %}
            {{ dump(key) }}
        {% endfor %}
    &lt;/div&gt;
{% endblock %}
</code></pre>

<p><kbd>There's my form</kbd></p>

<pre><code>&lt;?php

namespace AppBundle\Form;

use AppBundle\Entity\MembersEntity;
use AppBundle\Entity\RoleEntity;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class ChangeRoleForm extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder-&gt;add('roles', EntityType::class, array(
            'class' =&gt; RoleEntity::class,
            'choice_label' =&gt; 'nameRole',
            'multiple' =&gt; true,
            'expanded' =&gt; true,
            'choice_value' =&gt; 'nameRole',
        ))
            -&gt;add('update', SubmitType::class);
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver-&gt;setDefaults(array(
            'data_class' =&gt; null
        ));
    }
}
</code></pre>

<p>Any idea ?</p>