simialbi/yii2-widget-dropzone

Yii2 Dropzone widget

Installs: 161

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 13

Type:yii2-extension

2.0.0 2023-01-26 12:59 UTC

This package is auto-updated.

Last update: 2024-03-26 15:18:17 UTC


README

This extension provides the Dropzone integration for the Yii2 framework.

This fork is based on @DevGroup-ru's extension yii2-dropzone.

Installation

This extension requires Dropzone

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist simialbi/yii2-widget-dropzone "*"

or add

"simialbi/yii2-widget-dropzone": "*"

to the require section of your composer.json.

General Usage

use simialbi\yii2\dropzone\DropZone;

DropZone::widget(
    [
        'name' => 'file', // input name or 'model' and 'attribute'
        'url' => '', // upload url
        'storedFiles' => [], // stores files
        'clientOptions' => [], // dropzone js options
        'clientEvents' => [], // dropzone event handlers
        'options' => [] // container html options
    ]
)

you can also register simialbi\yii2\dropzone\UploadAction and simialbi\yii2\dropzone\RemoveAction actions in your controller