xsframe/think-qrcode

适用于 thinkphp6 的二维码生成工具

维护者

详细信息

gitee.com/he7/think-qrcode.git

主页

安装: 3

依赖者: 0

建议者: 0

安全: 0

类型:think-extend

1.0 2024-09-05 01:59 UTC

This package is not auto-updated.

Last update: 2024-09-20 01:06:34 UTC


README

适用于 thinkphp6 的二维码生成工具

安装方法

composer require xsframe/think-qrcode

配置方法

配置文件路径:/config/qrcode.php

  • cache_dir = 生成地址
  • background = 背景图片

使用方法

$code = new Qrcode();
$code_path = $code->png('text')                     //生成二维码
    ->logo('static/image/logo.png')                 //生成logo二维码
    ->background(180, 500)                          //给二维码加上背景
    ->text($role, 20, ['center', 740], '#ff4351')   //添加文字水印
    ->text($nick_name, 20, ['center', 780], '#000000')
    ->getPath();                                    //获取二维码生成的地址