2017 © Pedro Peláez
 

yii2-extension yii2-dropzone

Yii2 Dropzone Extention

image

twitf/yii2-dropzone

Yii2 Dropzone Extention

  • Tuesday, July 10, 2018
  • by twitf
  • Repository
  • 0 Watchers
  • 10 Stars
  • 49 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 40 % Grown

The README.md

twitf/yii2-dropzone

Latest Stable Version Total Downloads License, (*1)

Yii2 Dropzone Extention , Supports sorting, (*2)

, (*3)

PS:再三强调不要使用jquery2.2.4以上版本,不兼容jquery2.2.4以上版本(Again and again, do not use jquery2.2.4 or above, not compatible with jquery2.2.4 or above.), (*4)

可以在此处自定义资源包 xxxx/config/config.php配置如下
'components'=>[
            'assetManager' => [
            'bundles' => [
                'yii\web\JqueryAsset' => [
                    'sourcePath' => null,// 一定不要发布该资源
                    'js' => [
                        '/js/jquery-2.2.4.min.js',
                    ]
                ],
            ],
        ],
]

Installation

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

Either run, (*6)

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

or add, (*7)

"twitf/yii2-dropzone": "*"

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

Use

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

Controller Example (##This step is necessary.), (*10)

```php [ 'class' => 'twitf\dropzone\UploadAction', 'config' => [ "filePathFormat" => "/uploads/image/".date('YmdHis').'/', //上传保存路径 "fileRoot" => Yii::getAlias("@webroot"),//上传根目录 ], ], 'remove' => [ 'class' => 'twitf\dropzone\RemoveAction', 'config' => [ "fileRoot" => Yii::getAlias("@webroot"),//上传根目录 ], ], ]; } ``` >view Example 详情`\你的项目\vendor\twitf\yii2-dropzone\DropZone.php`的注释(我感觉已经很详细了) ```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('twitf\dropzone\DropZone', [ 'sortable'=>true, 'clientOptions' => [ 'maxFilesize' => '7', 'autoProcessQueue'=>true, 'dictCancelUpload'=>'取消上传', 'dictRemoveFile'=>'删除文件', 'addRemoveLinks'=>true ] ]); //Or echo \twitf\dropzone\DropZone::widget([ 'sortable'=>true, 'model' => $model, 'attribute' => 'file', 'clientOptions' => [ 'maxFilesize' => '7', 'autoProcessQueue'=>true, 'dictCancelUpload'=>'取消上传', 'dictRemoveFile'=>'删除文件', 'addRemoveLinks'=>true ] ]); ?>, (*11)

```, (*12)

有问题欢迎致电我的邮箱 837422076@qq.com, (*13)

The Versions

10/07 2018

dev-master

9999999-dev

Yii2 Dropzone Extention

  Sources   Download

Apache-2.0

The Requires

 

by Avatar twitf

extension yii2 dropzone uploadimage

22/03 2018

v0.4.1

0.4.1.0

Yii2 Dropzone Extention

  Sources   Download

Apache-2.0

The Requires

 

by Avatar twitf

extension yii2 dropzone uploadimage

08/01 2018

v0.4

0.4.0.0

Yii2 Dropzone Extention

  Sources   Download

Apache-2.0

The Requires

 

by Avatar twitf

extension yii2 dropzone uploadimage