jcabanillas/yii2-dropzone

Yii2 Dropzone widget

Installs: 100

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2021-04-26 00:28 UTC

This package is not auto-updated.

Last update: 2024-04-23 12:49:16 UTC


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 devgroup/yii2-dropzone "*"

or add

"devgroup/yii2-dropzone": "*"

to the require section of your composer.json.

General Usage

use jcabanillas\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 jcabanillas\dropzone\UploadAction and jcabanillas\dropzone\RemoveAction actions in your controller