You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi and sorry for my English,
I use symfony 2.7 and I have a manytoone relationship between client and commandea client has many commandes.
in ClientType:$builder->add('commandes', 'collection', array( 'label' => false, 'type' => new CommandeType(), 'options' => array( 'label' => false, ), 'allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'required' => true, 'by_reference' => false, 'delete_empty' => true, 'attr' => array( 'class' => 'collection', ),
in the twig view{% form_theme form 'jquery.collection.html.twig' %}$('.collection').collection({allow_add: true,allow_remove: true,'add': 'Add',min: 1,allow_up: false,allow_down: false,});
whene i render the form with {{form(form)}} it workbut
when i render manualy fields like this {{ form_widget(form.commandes) }} it does not workwhen i'm doing dump in the controller after sublit i have empty arraycollectionClient {#385 ▼ -id: null -nom: "test" -prenom: "test" -telephone: "0111111" -createdAt: null -updatesAt: null -email: "[email protected]" -commandes: ArrayCollection {#383 ▼ -elements: [] } }
The text was updated successfully, but these errors were encountered:
Hi and sorry for my English,
I use symfony 2.7 and I have a manytoone relationship between client and commandea client has many commandes.
in ClientType:$builder->add('commandes', 'collection', array( 'label' => false, 'type' => new CommandeType(), 'options' => array( 'label' => false, ), 'allow_add' => true, 'allow_delete' => true, 'prototype' => true, 'required' => true, 'by_reference' => false, 'delete_empty' => true, 'attr' => array( 'class' => 'collection', ),
in the twig view
{% form_theme form 'jquery.collection.html.twig' %}$('.collection').collection({allow_add: true,allow_remove: true,'add': 'Add',min: 1,allow_up: false,allow_down: false,});
whene i render the form with {{form(form)}} it workbut
when i render manualy fields like this {{ form_widget(form.commandes) }} it does not workwhen i'm doing dump in the controller after sublit i have empty arraycollectionClient {#385 ▼ -id: null -nom: "test" -prenom: "test" -telephone: "0111111" -createdAt: null -updatesAt: null -email: "[email protected]" -commandes: ArrayCollection {#383 ▼ -elements: [] } }
The text was updated successfully, but these errors were encountered: