Symfony form how to add class to form group
<p>Using:</p>

<pre><code>-&gt;add('name', TextType::class, [
                'label' =&gt; 'Name',
                'required' =&gt; true,
                'attr' =&gt; [
                    'class' =&gt; 'myclass'
                ],
            ])
</code></pre>

<p>I'm adding the class "myclass" to the <code>&lt;input&gt;</code> element, getting:</p>

<pre><code>&lt;div class="form-group"&gt;
  &lt;label ...&gt;Name&lt;/label&gt;
  &lt;input type="text" required="required" class="myclass" ...&gt;
&lt;/div&gt;
</code></pre>

<p>What if I wanted to add the "myclass" class not to the input itself, but to its <code>&lt;div class="form-group"&gt;</code> container, in order to get:</p>

<pre><code>&lt;div class="form-group myclass"&gt;
  &lt;label ...&gt;Name&lt;/label&gt;
  &lt;input type="text" required="required" ...&gt;
&lt;/div&gt;
</code></pre>

<p>What's the best way to accomplish that?</p>