symfony - Wrong choices in my choices list -


with symfony 2.7, have 2 differents forms in webpage :

form 1 :

public function buildform(formbuilderinterface $builder, array $options) {     /*         $choices = array(             0 => (entity "personne"),             1 => b  (entity "personne")         )      *       */     $builder         ->add('personne', 'entity', array(             'class' => 'logicielbundle:personne',             'choices' => $choices,             'label' => 'banque'         ))     ; }  public function getname() {     return 'logiciel_remise_selection_form'; } 

form 2

public function buildform(formbuilderinterface $builder, array $options) {     /*         $choices = array(             3 => c (entity "personne"),             4 => d (entity "personne")         )      *       */     $builder         ->add('personne', 'entity', array(             'class' => 'logicielbundle:personne',             'choices' => $choices,             'label' => 'banque'         ))     ; }  public function getname() {     return 'logiciel_remise_form'; } 

my controller :

    $form1 = $this->createform('logiciel_remise_selection_form', null);     $this->submit($form1);     if($form1->handlerequest($request)->isvalid()) {         $remise = new remise;         $form2 = $this->createform('logiciel_remise_form', $remise);     } 

but in webpage < select >, "form2", have choices a , b ... it choice of "form1" o_o

when dump() "form2", have choices c , d (good choices) have same "idreader" in choices_list (i not know is) "form1" ( https://github.com/symfony/symfony/blob/master/src/symfony/bridge/doctrine/form/choicelist/idreader.php )

can me ?


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -