ommu / yii2-dropzone
Yii2 Dropzone widget
Installs: 82
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 13
Open Issues: 0
Type:yii2-extension
Requires
- npm-asset/dropzone: ~5.5
- yiisoft/yii2: 2.0.*
- yiisoft/yii2-jui: 2.0.*
Requires (Dev)
- yiisoft/yii2-debug: 2.0.*
README
This extension provides the Dropzone integration for the Yii2 framework.
Installation
This extension requires Dropzone
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist ommu/yii2-dropzone "*"
or add
"ommu/yii2-dropzone": "*"
to the require section of your composer.json.
General Usage
use devgroup\dropzone\DropZone; echo 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 ]);
Input Form Usage
use devgroup\dropzone\DropZone; echo $form->field($model, "attribute")->widget(DropZone::className(), [ '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 devgroup\dropzone\UploadAction
and devgroup\dropzone\RemoveAction
actions in your controller