Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty collection when render fiedsl manually #154

Open
aymen2255 opened this issue Sep 26, 2019 · 0 comments
Open

empty collection when render fiedsl manually #154

aymen2255 opened this issue Sep 26, 2019 · 0 comments

Comments

@aymen2255
Copy link

aymen2255 commented Sep 26, 2019

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: [] } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant