boundstate/yii2-plupload
最新稳定版本:v0.0.2
Composer 安装命令:
composer require boundstate/yii2-plupload
包简介
The plupload extension for the Yii framework
关键字:
README 文档
README
A plupload extension for the Yii2 framework
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist boundstate/yii2-plupload "*"
or add
"boundstate/yii2-plupload": "*"
to the require section of your composer.json file.
Usage
Action
public function actions() { return [ 'upload' => [ 'class' => PluploadAction::className(), 'onComplete' => function ($filename, $params) { // Do something with file } ], ]; }
Widget
<?= Plupload::widget([ 'url' => ['upload'], 'browseLabel' => 'Upload', 'browseOptions' => ['id' => 'browse', 'class' => 'btn btn-success'], 'options' => [ 'filters' => [ 'mime_types' => [ ['title' => 'Excel files', 'extensions' => 'csv,xls,xlsx'], ], ], ], 'events' => [ 'FilesAdded' => 'function(uploader, files){ $("#error-container").hide(); $("#browse").button("loading"); uploader.start(); }', 'FileUploaded' => 'function(uploader, file, response){ $("#browse").button("reset"); }', 'Error' => 'function (uploader, error) { $("#error-container").html(error.message).show(); $("#browse").button("reset"); }' ], ]); ?>
统计信息
- 总下载量: 5.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-10