2017 © Pedro Peláez
 

yii2-extension yii2-dropzone

Yii2 Dropzone Extention

image

coldfox/yii2-dropzone

Yii2 Dropzone Extention

  • Monday, June 4, 2018
  • by hujian2855
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

coldfox/yii2-dropzone

Yii2 Dropzone Extention , Supports sorting, (*1)

Installation

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

Either run, (*3)

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

or add, (*4)

"codefox/yii2-dropzone": "*"

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

Use

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

Controller Example, (*7)

```php <?php public function actions(){ return [ 'upload' => [ 'class' => 'coldfox\dropzone\DropZoneUploadAction', 'config' => [ "filePathFormat" => "/uploads/source_code/".date('Ymd').'/', //上传保存路径 "fileRoot" => Yii::getAlias("@uploadRoot"),//上传根目录 ], ], 'remove' => [ 'class' => 'coldfox\dropzone\RemoveAction', 'config' => [ "fileRoot" => Yii::getAlias("@uploadRoot"),//上传根目录 ], ], ]; }, (*8)

```, (*9)

view Example 详情\你的项目\vendor\coldfox\yii2-dropzone\AbstractDropZone.php的注释(我感觉已经很详细了), (*10)

```php true, /** * Sortable配置参数 * 详情参阅 https://github.com/RubaXa/Sortable#options * @var array */ 'sortableOption' => [], //回显的数据 内容我格式大概就这样子 'mockFiles'=>['/uploads/image/20180107152242/xxxxxx.jpg','/uploads/image/20180107152242/xxxxxxx.jpg'], /* * dropzone配置选项, * 详情参阅 http://www.dropzonejs.com/#configuration-options * @var array */ 'clientOptions' => [ 'maxFiles'=>5, 'maxFilesize' => '7', 'autoProcessQueue'=>false, 'dictCancelUpload'=>'取消上传', 'dictRemoveFile'=>'删除文件', 'addRemoveLinks'=>true ], /**dropzone事件侦听 * 详情参阅 http://www.dropzonejs.com/#event-list * @var array */ 'clientEvents'=>[ 'success'=>'function (file, response) {console.log(response)}', ] ] ); //Or echo $form->field($model, 'file')->widget('coldfox\dropzone\DropZone', [ 'sortable'=>true, 'clientOptions' => [ 'maxFilesize' => '7', 'autoProcessQueue'=>true, 'dictCancelUpload'=>'取消上传', 'dictRemoveFile'=>'删除文件', 'addRemoveLinks'=>true ] ]); //Or echo \coldfox\dropzone\DropZone::widget([ 'sortable'=>true, 'model' => $model, 'attribute' => 'file', 'clientOptions' => [ 'maxFilesize' => '7', 'autoProcessQueue'=>true, 'dictCancelUpload'=>'取消上传', 'dictRemoveFile'=>'删除文件', 'addRemoveLinks'=>true ] ]); ?>, (*11)

```, (*12)

基于twitf/dropzone修改, (*13)

The Versions

04/06 2018

dev-master

9999999-dev

Yii2 Dropzone Extention

  Sources   Download

Apache-2.0

The Requires

 

by coldfox

extension yii2 dropzone uploadimage

04/06 2018

v0.1

0.1.0.0

Yii2 Dropzone Extention

  Sources   Download

Apache-2.0

The Requires

 

by coldfox

extension yii2 dropzone uploadimage