Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.21 KB

frontend_dropzone.md

File metadata and controls

34 lines (24 loc) · 1.21 KB

Use Dropzone in your Symfony2 application

Download Dropzone and include it in your template. Connect the action property of the form to the dynamic route _uploader_{mapping_name}.

<script type="text/javascript" src="https://rawgit.com/enyo/dropzone/master/dist/dropzone.js"></script>

<form action="{{ oneup_uploader_endpoint('gallery') }}" class="dropzone" style="width:200px; height:200px; border:4px dashed black">
</form>

Configure the OneupUploaderBundle to use the correct controller:

# app/config/config.yml

oneup_uploader:
    mappings:
        gallery:
            frontend: dropzone

Be sure to check out the official manual for details on the configuration.

Next steps

After this setup, you can move on and implement some of the more advanced features. A full list is available here.