定制 xj/yii2-qrcode-widget 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

xj/yii2-qrcode-widget

最新稳定版本:1.1

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固