2017 © Pedro Peláez
 

yii2-extension yii2-dropzone

yii2-dropzone

image

zzbajie/yii2-dropzone

yii2-dropzone

  • Wednesday, July 4, 2018
  • by zzbajie
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2-dropzone

yii2-dropzone, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist zzbajie/yii2-dropzone "dev-master"

or add, (*4)

"zzbajie/yii2-dropzone": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

php <?= \zzbajie\dropzone\DropZone::widget( [ 'name' => 'img', // input name or 'model' and 'attribute' 'url' => 'upload-main', // upload url 'storedFiles' => [ ], // stores files 'eventHandlers' => [], // dropzone event handlers 'sortable' => false, // sortable flag 'sortableOptions' => [], // sortable options 'htmlOptions' => [ ], // container html options 'options' => [ 'params' => ['productId' => $model->id,], //'addRemoveLinks' => true, //'dictRemoveFile' => "删除", 'dictCancelUpload' => "取消", 'dictDefaultMessage' => '<button class="btn btn-default btn-flat" type="button" id="submit-img-btn">点击或拖拽图片到这里 (<span style="color:#7e0099;"> 宽600px * 高600px </span>)</button>', 'acceptedFiles' => "image/*", 'uploadMultiple' => false, ], // dropzone js options 'eventHandlers' => [ 'complete' => "function(file){console.log(file)}", 'removedfile' => "function(file){alert(file.name + ' is removed')}", //'sending' => "function(file, xhr, formData){formData.append('" . Yii::$app->request->csrfParam . "','" . Yii::$app->request->getCsrfToken() . "')}" ] ] ); ?>, (*7)

The Versions

04/07 2018

dev-master

9999999-dev

yii2-dropzone

  Sources   Download

Apache-2.0

The Requires

 

by Avatar zzbajie

extension yii2