I have SuperType
Form for Entity Super
.
In this form I have a collection
field of ChildType
Form types for Entity
You can pass an array of options to your childType as follows:
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('childrens', 'collection', array(
'entry_type' => new ChildType(),
'entry_options' => array(
'my_custom_option' => true,
),
// ...
}
In Symfony 3, this is called entry_options.
$builder->add('childrens', CollectionType::class, array(
'entry_type' => ChildType::class,
'entry_options' => array(
'my_custom_option' => true
),
));