andru19/yii2-dropzone
Composer 安装命令:
composer require andru19/yii2-dropzone
包简介
Yii2 Dropzone widget
关键字:
README 文档
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 andru19/yii2-dropzone "*"
or add
"andru19/yii2-dropzone": "*"
to the require section of your composer.json.
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by to create Ajax upload area :
echo \andru\dropzone\DropZone::widget();
General Usage
use andru\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 ] ) echo \andru\dropzone\DropZone::widget([ 'options' => [ 'maxFilesize' => '2', ], 'clientEvents' => [ 'complete' => "function(file){console.log(file)}", 'removedfile' => "function(file){alert(file.name + ' is removed')}" ], ]); you can also register `andru\dropzone\UploadAction` and `andru\dropzone\RemoveAction` actions in your controller
统计信息
- 总下载量: 1.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-01-31