This extension provides the Dropzone integration for the Yii2 framework.
This extension requires Dropzone
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist victorruan/yii2-dropzone "*"
or add
"victorruan/yii2-dropzone": "*"
to the require section of your composer.json.
use victorruan\dropzone\DropZone;
DropZone::widget(
[
'name' => 'file', // input name or 'model' and 'attribute'
'url' => '', // upload url
'storedFiles' => [], // stores files
'eventHandlers' => [], // dropzone event handlers
'sortable' => true, // sortable flag
'sortableOptions' => [], // sortable options
'htmlOptions' => [], // container html options
'options' => [], // dropzone js options
]
)
you can also register victorruan\dropzone\UploadAction
and victorruan\dropzone\RemoveAction
actions in your controller