PHPackages                             xyb/yii2-qiniu-upload-widget - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. xyb/yii2-qiniu-upload-widget

ActiveYii2-extension

xyb/yii2-qiniu-upload-widget
============================

这是一个七牛js小部件

5532[1 PRs](https://github.com/smartyPHP/yii2-qiniu-upload-widget/pulls)JavaScript

Since Sep 25Pushed 8y ago2 watchersCompare

[ Source](https://github.com/smartyPHP/yii2-qiniu-upload-widget)[ Packagist](https://packagist.org/packages/xyb/yii2-qiniu-upload-widget)[ RSS](/packages/xyb-yii2-qiniu-upload-widget/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

七牛jssdk组件的yii2部件
================

[](#七牛jssdk组件的yii2部件)

用于上传到七牛的小部件

安装
--

[](#安装)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist xyb/yii2-qiniu-upload-widget "dev-master"

```

or add

```
"xyb/yii2-qiniu-upload-widget": "dev-master"

```

to the require section of your `composer.json` file.

基本用法
----

[](#基本用法)

使用如下:

js参数和七牛的jssdk参数一致,使用数组方式传递

1.在view视图输出,domain参数要填好,也就是的上传目的地址

```

```

2.加载uploadToken的action,默认路由是/site/tokenAction,eg:在siteController的actions方法添加,action的参数必须填写好七牛的accessKey,secretKey,bucker,domain

```
public function actions()
{
    return [
        'error' => [
            'class' => 'yii\web\ErrorAction',
        ],
        'captcha' => [
            'class' => 'yii\captcha\CaptchaAction',
            'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
        ],
        'tokenAction' => [
            'class' => 'xyb\qiniu\TokenAction',
            'ak' => Yii::$app->params['qiniu']['ak'],
            'sk' => Yii::$app->params['qiniu']['sk'],
            'domain' => Yii::$app->params['qiniu']['domain'],
            'bucket' => Yii::$app->params['qiniu']['bucket']
        ],
    ];
}
```

额外用法
----

[](#额外用法)

可以传递自定义的html作为上传组件的界面,定义containerId和browseButtonId只需要在节点定义,如 ``其中,{!!containerId!!}会动态解析为基于组件传递的id的containerId,{!!browseButtonId!!}亦同理,更多请参考源码注释

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7eeaacac98a2bae9a7b16241bdb4b312e5c880c14f7085aedc1aec675409e7d?d=identicon)[smartyPHP](/maintainers/smartyPHP)

---

Top Contributors

[![imxyb](https://avatars.githubusercontent.com/u/7411249?v=4)](https://github.com/imxyb "imxyb (2 commits)")

### Embed Badge

![Health badge](/badges/xyb-yii2-qiniu-upload-widget/health.svg)

```
[![Health](https://phpackages.com/badges/xyb-yii2-qiniu-upload-widget/health.svg)](https://phpackages.com/packages/xyb-yii2-qiniu-upload-widget)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
