@@ -54,13 +54,9 @@ in a form. For example, suppose you have an ``emails`` field that corresponds
5454to an array of email addresses. In the form, you want to expose each email
5555address as its own input text box::
5656
57- use Symfony\Component\Form\Extension\Core\Type\CollectionType;
58- use Symfony\Component\Form\Extension\Core\Type\EmailType;
59- // ...
60-
61- $builder->add('emails', CollectionType::class, array(
57+ $builder->add('emails', 'Symfony\Component\Form\Extension\Core\Type\CollectionType', array(
6258 // each entry in the array will be an "email" field
63- 'entry_type' => EmailType::class ,
59+ 'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\ EmailType' ,
6460 // these options are passed to each "email" type
6561 'entry_options' => array(
6662 'required' => false,
@@ -294,12 +290,8 @@ as your `entry_type`_ option (e.g. for a collection of drop-down menus),
294290then you'd need to at least pass the ``choices `` option to the underlying
295291type::
296292
297- use Symfony\Component\Form\Extension\Core\Type\CollectionType;
298- use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
299- // ...
300-
301- $builder->add('favorite_cities', CollectionType::class, array(
302- 'entry_type' => ChoiceType::class,
293+ $builder->add('favorite_cities', 'Symfony\Component\Form\Extension\Core\Type\CollectionType', array(
294+ 'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\ChoiceType',
303295 'entry_options' => array(
304296 'choices' => array(
305297 'nashville' => 'Nashville',
@@ -378,13 +370,9 @@ for all entries with the ``entry_options`` option will be used.
378370
379371.. code-block :: php
380372
381- use Symfony\Component\Form\Extension\Core\Type\CollectionType;
382- use Symfony\Component\Form\Extension\Core\Type\TextType;
383- // ...
384-
385- $builder->add('tags', CollectionType::class, array(
373+ $builder->add('tags', 'Symfony\Component\Form\Extension\Core\Type\CollectionType', array(
386374 'class' => 'AppBundle\Entity\Tag',
387- 'entry_type' => TextType::class ,
375+ 'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\ TextType' ,
388376 'allow_add' => true,
389377 'prototype' => true,
390378 'prototype_data' => 'New Tag Placeholder',
0 commit comments