php - Symfony Form with subform -


i have user form , contact form in user form tried add contact form user form

when tried add

$builder->add(             'contact',             new contacttype()         ); 

it failed with

you cannot add children simple form. maybe should set option "compound" true? 

tried set compound didnt work

/**  * {@inheritdoc}  */ public function configureoptions(optionsresolver $resolver) {     $defaults = array(         'compound' => true,         'inherit_data' => true,     );      $resolver->setdefaults($defaults); } 

the compound option default set true.

  1. how did extend form type class? abstractformtype, or else?
  2. did override getparent() method?

this explain compound being set false.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -