PHPackages                             xj/yii2-qrcode-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xj/yii2-qrcode-widget

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xj/yii2-qrcode-widget
=====================

yii2-qrcode-widget

1.1(11y ago)1443.1k↓28%9[1 issues](https://github.com/xjflyttp/yii2-qrcode-widget/issues)BSD-3-ClausePHP

Since Jan 15Pushed 9y ago4 watchersCompare

[ Source](https://github.com/xjflyttp/yii2-qrcode-widget)[ Packagist](https://packagist.org/packages/xj/yii2-qrcode-widget)[ RSS](/packages/xj-yii2-qrcode-widget/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

yii2-qrcode-widget
==================

[](#yii2-qrcode-widget)

composer.json
-------------

[](#composerjson)

```
"require": {
    "xj/yii2-qrcode-widget": "~1.1"
},
```

example:
--------

[](#example)

```
use xj\qrcode\QRcode;
use xj\qrcode\widgets\Text;
use xj\qrcode\widgets\Email;
use xj\qrcode\widgets\Card;

//Widget create a QR Image Url //QR Created by Widget
Text::widget([
    'outputDir' => '@webroot/upload/qrcode',
    'outputDirWeb' => '@web/upload/qrcode',
    'ecLevel' => QRcode::QR_ECLEVEL_L,
    'text' => 'test',
    'size' => 6,
]);

//Widget create a Action URL //QR Create by Action
Text::widget([
    'actions' => ['site/qrcode'],
    'text' => 'aaaa@gmail.com',
    'size' => 3,
    'margin' => 4,
    'ecLevel' => QRcode::QR_ECLEVEL_L,
]);

//other type
//Create EMAIL
Email::widget([
    'email' => 'aaaa@gmail.com',
    'subject' => 'myMail',
    'body' => 'do something',
]);

//Create Card
Card::widget([
    'actions' => ['clientQrcode'],
    'name' => 'SB',
    'phone' => '1111111111111',
    //here jpeg file is only 40x40, grayscale, 50% quality!
    'avatar' => '@webroot/avatar.jpg',
]);

//Create Sms
Smsphone::widget([
    'actions' => ['clientQrcode'],
    'phone' => '131111111111',
]);
//Create Tel
Telphone::widget([
    'actions' => ['clientQrcode'],
    'phone' => '131111111111',
]);
```

// For Widget + Actions// the Action Parts // Below 2 pars is Blacklist and Whilelist, choose one are ok.
---------------------------------------------------------------------------------------------------------

[](#-for-widget--actions-the-action-parts-below-2-pars-is--blacklist-and-whilelist-choose-one-are-ok)

Action:
-------

[](#action)

```
// for the black list
public function actions() {
    return [
        //deny widget set size & margin & ecLevel
        'qrcode' => [
            'class' => QRcodeAction::className(),
            'enableCache' => false,
            //
            'allowClientEclevel' => false,
            'ecLevel' => QRcode::QR_ECLEVEL_H,
            //
            'defaultSize' => 4,
            'allowClientSize' => false,
            //
            'defaultMargin' => 2,
            'allowClientMargin' => false,
        ]
    ];
}

```php
// for the while list
public function actions() {
    return [
        //allow widget set size & margin & ecLevel
        'qrcode' => [
            'class' => QRcodeAction::className(),
            //you can disable cache
            'enableCache' => true,
            //
            'allowClientEclevel' => true,
            'ecLevel' => QRcode::QR_ECLEVEL_H,
            //
            'defaultSize' => 4,
            'allowClientSize' => true,
            'maxSize' => 10,
            //
            'defaultMargin' => 2,
            'allowClientMargin' => true,
            'maxMargin' => 10,
            'outputDir' => '@webroot/upload/qrcode',

            //closure, you can ignore this selection.
            'onGetFilename' => function (QRcodeAction $data) {
                /* @var $data QRcodeAction */
                //dosomething
                return sha1($data->text) . '.png';
            }
        ]
    ];
}
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4142d ago

### Community

Maintainers

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

---

Top Contributors

[![xjflyttp](https://avatars.githubusercontent.com/u/128428?v=4)](https://github.com/xjflyttp "xjflyttp (7 commits)")

### Embed Badge

![Health badge](/badges/xj-yii2-qrcode-widget/health.svg)

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

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)

PHPackages © 2026

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