How to pass options to CustomType in `collection` field Symfony 2.1?

前端 未结 2 1919
说谎
说谎 2021-02-05 05:03

I have SuperType Form for Entity Super.

In this form I have a collection field of ChildType Form types for Entity

2条回答
  •  花落未央
    2021-02-05 05:53

    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
        ),
    ));
    

提交回复
热议问题