I have a form type:
$builder->add('paises', 'collection', array(
'options' => array('data_class' =>'Acc\ApssBundle\Entity\Pais'),
'prototype' => true,
'type' => new PaisType(),
)) ;
How to add attribute "name" to the class Pais to the label form ??
In twig I have:
{% for pais in form.paises %}
<col>
<td>{{ form_label(pais.name) }}</td>
</col>
{% endfor %}
Thank you very much!!
Quick and dirty:
It's not a solution but you could just as well do:
<td>{{ pais.vars.data.name }}</td>
.Proper way:
Within
PaisType
setup theFormEvent
so form is data-aware:Hope either of these help ;)