emnabs/yii2-plupload
最新稳定版本:1.2.9
Composer 安装命令:
composer require emnabs/yii2-plupload
包简介
Yii2 Plupload Widget
关键字:
README 文档
README
yii2-plupload is a widget based plupload solution for Yii2. It is released under the BSD 3-Clause license.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist emnabs/yii2-plupload "*"
or add
"emnabs/yii2-plupload": "*"
to the require section of your composer.json.
Usage
To use this widget, you have to add the code in your viewer page:
Usage With ActiveForm and model
use emhome\plupload\Plupload;
echo $form->field($model, 'thumb')->widget(Plupload::classname(), [
'url' => ['upload'],
//'wrapperOptions' => ['width' => 200, 'height' => 200],
//'resize' => ['width' => 200, 'height' => 200],
'autoUpload' => true,
'options' => [
'filters' => [
'mime_types' => [
[
'title' => "Image files",
'extensions' => "jpg,gif,png"
],
]
],
],
]);
Usage Without ActiveForm model
use emhome\plupload\Plupload;
Plupload::widget([
'url' => ['upload'],
'browseLabel' => '上传文件',
'autoUpload' => true,
'errorContainer' => 'errorUpload',
'options' => [
'filters' => [
'max_file_size' => '20kb',
'mime_types' => [
[
'title' => "Image files",
'extensions' => "jpg,gif,png"
],
]
],
],
'events' => [],
]);
Usage actions with PluploadAction
public function actions() { return [ ... 'plupload' => [ 'class' => 'emhome\plupload\PluploadAction', 'onComplete' => function($file, $params) { //上传完成后操作 ... return [ 'file' => $file, 'params' => $params ]; }, ], ... ]; }
License
yii2-plupload is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.
Plupload
Copyright 2016, Ephox
Released under GPLv2 License
统计信息
- 总下载量: 175
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-06-14