Skip to content

empty collection when render fiedsl manually #154

@aymen2255

Description

@aymen2255

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions