mztest/yii2-widget-upload-oss
Composer 安装命令:
composer require mztest/yii2-widget-upload-oss
包简介
A widget for uploading files to AliYun OSS
README 文档
README
A widget for uploading files to AliYun OSS
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require mztest/yii2-widget-upload-oss
or add
"mztest/yii2-widget-upload-oss": "*"
to the require section of your composer.json file.
Usage
-
Set signature action at your controller
public function actions() { return [ 'upload' => [ 'oss-signature' => [ 'class' => 'mztest\uploadOSS\actions\Signature', 'accessKeyId' => 'Your aliyunOSS access key id here.', 'accessKeySecret' => 'Your aliyunOSS access secret id here.', 'host' => 'Your aliyunOSS upload bucket url', ], ], ]; }
-
Simply use it in your code by :
<?= \mztest\uploadOSS\FileUploadOSS::widget(); ?>
or
<?= $form->field($model, 'url')->widget(FileUploadOSS::className(), [ 'signatureAction' => ['oss-signature'] ]) ?>
统计信息
- 总下载量: 275
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-28