craue / CraueFormFlowBundle

Multi-step forms for your Symfony project.
MIT License
736 stars 118 forks source link

How to use collection type in a step? #328

Open mdimitris opened 6 years ago

mdimitris commented 6 years ago

Hello! I would like to use collection type to my form to the third step because I need to add multiple previous job (WorkExperience entities) to the use who submits the form. I followed this guide https://symfony.com/doc/current/form/form_collections.html but so far without great success..

My questions are:

Below I am attaching the code that I use:

ApplicationType.php (Step 1)

$builder->add('previousjobs', CollectionType::class, array( 'entry_type' => WorkExperienceType::class, 'allow_add' => true, 'prototype' => true, 'prototype_data' => 'New Tag Placeholder', ))

grzegorz-stolarz commented 5 years ago

@bump

Need the same operation but don't know how to work with it.

grzegorz-stolarz commented 5 years ago

@bump