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
.
- how did extend form type class?
abstractformtype
, or else? - did override
getparent()
method?
this explain compound
being set false
.
Comments
Post a Comment