dev-master
9999999-devYii2 Dropzone widget
GPL-3.0+
The Requires
- yiisoft/yii2 2.0.*
- bower-asset/dropzone 4.0.1
The Development Requires
by Andrew
by Evgeny Dubovitsky
yii2 upload dropzone
Yii2 Dropzone widget
This extension provides the Dropzone integration for the Yii2 framework., (*1)
This extension requires Dropzone, (*2)
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer.phar require --prefer-dist andru19/yii2-dropzone "*"
or add, (*5)
"andru19/yii2-dropzone": "*"
to the require section of your composer.json
file., (*6)
Once the extension is installed, simply use it in your code by to create Ajax upload area :, (*7)
echo \andru\dropzone\DropZone::widget();
```php, (*8)
use andru\dropzone\DropZone;, (*9)
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 ] ), (*10)
echo \andru\dropzone\DropZone::widget([ 'options' => [ 'maxFilesize' => '2', ], 'clientEvents' => [ 'complete' => "function(file){console.log(file)}", 'removedfile' => "function(file){alert(file.name + ' is removed')}" ], ]);, (*11)
you can also register andru\dropzone\UploadAction
and andru\dropzone\RemoveAction
actions in your controller, (*12)
Yii2 Dropzone widget
GPL-3.0+
yii2 upload dropzone