php - Symfony - How to pass a variable to an embedded form -


i'm facing problem symfony3 , forms.

i have parent form embedded child form. controller, can send data can use in parent form $options array ($options['vara'], ...).

$form = $this->createform(parententitytype::class, $objparent, array('vara'=>$vara, 'varb'=>$varb)); 

but if want pass varb variable (for example) embedded form ? what's proper solution ?

any appreciated, thanks.

something this, in first form:

$builder->add('name', myformtype::class, [             'data' => $options['varb'] ]); 

but better if share forms codes. main key pass variables $options['key'] in buildform() method.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -