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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -