craueformflow

Handling a complex Symfony2 form with multiple entities relationship

天涯浪子 提交于 2019-12-13 01:43:46
问题 I have a form (still not finished and is missing many fields) that is handled as a wizard with steps, in which fields from multiple entities are handled. This is the form itself: public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('tipo_tramite', 'entity', array( 'class' => 'ComunBundle:TipoTramite', 'property' => 'nombre', 'required' => TRUE, 'label' => "Tipo de Trámite", 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder