I have a collection widget in my form. It looks like this:
Teams 0 player1 inputfield
1 player2 inputfield
I would not want to display the word βteamsβ and β0β and β1β. I have this block in my fields.html.twig template, but not quite sure how to change this.
{% block collection_widget %} {% spaceless %} {% if prototype is defined %} {% set attr = attr|merge({'data-prototype': form_row(prototype) }) %} {% endif %} {{ block('form_widget') }} {% endspaceless %} {% endblock collection_widget %} {% block form_label %} {% spaceless %} <div class="hidden"> {{ block('generic_label') }} </div> {% endspaceless %} {% endblock form_label %}
ChallengeType Form:
class ChallengeType extends AbstractType { public function buildForm(FormBuilder $builder, array $options) { $builder ->add('teams', 'collection', array( 'type' => new TeamType(), 'allow_add' => true )) ->add('place') ->add('date'); } public function getName() { return 'challenge'; } public function getDefaultOptions(array $options) { return array('data_class' => 'Tennisconnect\DashboardBundle\Entity\Challenge'); } }
thanks.
source share