File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,29 @@ type::
303
303
],
304
304
]);
305
305
306
+ prototype_options
307
+ ~~~~~~~~~~~~~~~~~
308
+
309
+ **type **: ``array `` **default **: ``[] ``
310
+
311
+ This is the array that's passed to the form type specified in the `entry_type `_
312
+ option when creating its prototype. It allows to have different options depending
313
+ on whether you are adding a new entry or editing an existing entry.
314
+
315
+ use Symfony\C omponent\F orm\E xtension\C ore\T ype\C ollectionType;
316
+ use Symfony\C omponent\F orm\E xtension\C ore\T ype\T extType;
317
+ // ...
318
+
319
+ $builder->add('names', CollectionType::class, [
320
+ 'entry_type' => TextType::class,
321
+ 'entry_options' => [
322
+ 'help' => 'You can edit this name here.',
323
+ ],
324
+ 'prototype_options' => [
325
+ 'help' => 'You can enter a new name here.',
326
+ ],
327
+ ]);
328
+
306
329
entry_type
307
330
~~~~~~~~~~
308
331
You can’t perform that action at this time.
0 commit comments