File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -369,8 +369,23 @@ prototype_data
369
369
370
370
**type **: ``mixed `` **default **: ``null ``
371
371
372
- Allows you to specify data for the prototype. Each new row added will initially
373
- contain the data set by this option.
372
+ Allows you to define a specific data for the prototype. Each new row added will
373
+ initially contain the data set by this option.
374
+ By default, the same data as defined with ``entry_options `` for other entries
375
+ will be used.
376
+
377
+ .. code-block :: php
378
+
379
+ use Symfony\Component\Form\Extension\Core\Type\CollectionType;
380
+ use Symfony\Component\Form\Extension\Core\Type\TextType;
381
+
382
+ $builder->add('tags', CollectionType::class, array(
383
+ 'class' => \AppBundle\Entity\Tag::class,
384
+ 'entry_type' => TextType::class,
385
+ 'allow_add' => true,
386
+ 'prototype' => true,
387
+ 'prototype_data' => 'New Tag Placeholder',
388
+ ));
374
389
375
390
prototype_name
376
391
~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments