Friday, 15 May 2015

php - Handling an upload of collection of files with doctrine -



php - Handling an upload of collection of files with doctrine -

i've read part of symfony2 doc: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html , made work me. if have collection of 'file' fields 'allow_add' attribute, don't know how many files user post via form? how handle them in same way?

you need tell form take multiple files this

{{ form_widget(form.file, { 'attr': { 'multiple': 'multiple' } }) }}

or this

{{ form_widget(yourform.file, { 'full_name': yourform.file.get('full_name') ~ '[]' }) }}

read here https://github.com/symfony/symfony/issues/1400

this way can select , upload multiple files @ once.

php symfony2

No comments:

Post a Comment