xj/yii2-qrcode-widget 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xj/yii2-qrcode-widget

Composer 安装命令:

composer require xj/yii2-qrcode-widget

包简介

yii2-qrcode-widget

README 文档

README

composer.json

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

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.

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';
            }
        ]
    ];
}

xj/yii2-qrcode-widget 适用场景与选型建议

xj/yii2-qrcode-widget 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 44.34k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2015 年 01 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 xj/yii2-qrcode-widget 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 xj/yii2-qrcode-widget 我们能提供哪些服务?
定制开发 / 二次开发

基于 xj/yii2-qrcode-widget 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 44.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 28
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 4
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-01-14