forked from DevGroup-ru/yii2-dropzone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,49 @@ | ||
yii2-dropzone | ||
============= | ||
Dropzone Extension for Yii 2 | ||
============================== | ||
|
||
This extension provides the [Dropzone](http://www.dropzonejs.com/) integration for the Yii2 framework. | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
This extension requires [Dropzone](https://github.com/enyo/dropzone) | ||
|
||
The preferred way to install this extension is through [composer](http://getcomposer.org/download/). | ||
|
||
Either run | ||
|
||
``` | ||
php composer.phar require --prefer-dist devgroup/yii2-dropzone "*" | ||
``` | ||
|
||
or add | ||
|
||
``` | ||
"devgroup/yii2-dropzone": "*" | ||
``` | ||
|
||
to the require section of your composer.json. | ||
|
||
|
||
General Usage | ||
------------- | ||
|
||
```php | ||
use devgroup\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 `devgroup\dropzone\UploadAction` and `devgroup\dropzone\RemoveAction` actions in your controller |