GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - phalapi/qrcode: PhalApi 二维码扩展,基于QRCode实现。

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

二维码扩展

PhalApi 二维码扩展,基于PHP QRCode实现。可用于生成二维码图片。

版本与运行环境

项目 说明
当前版本 v8.0.0
PHP 要求 >= 8.0(已实测 8.0 与 8.4)
扩展依赖 gd(生成 PNG 图片必需)

版本号说明:v8.0.0 中的 8 表示“支持 PHP 8”,不是 PhalAPI 的第 8 代版本。

本扩展代码已通过 PHP 8.0 与 8.4 实测(生成 PNG 正常、无弃用告警),v8.0.0 起 composer.json 要求 php >=8.0。

安装和配置

修改项目下的composer.json文件,并添加:

    "phalapi/qrcode":"^8.0"

然后执行composer update。

注册

在/path/to/phalapi/config/di.php文件中,注册:

$di->qrcode = function() {
    return new \PhalApi\QrCode\Lite();
};

使用

第一种使用方式:直接输出二维码图片:

\PhalApi\DI()->qrcode->png('Hello PhalApi!', false, 'L', 4);

效果类似如下:

或者直接浏览器访问:http://api.phalapi.net/?s=QrCode.Png&data=Hello%20PhalApi!&size=10

第二种使用方式:将二维码图片保存到文件。

\PhalApi\DI()->qrcode->png('Hello PhalApi!', '/path/to/your_file.png', 'L', 4);

代码示例

可参考PhalApi的示例源代码。

About

PhalApi 二维码扩展,基于QRCode实现。

Resources

Readme
Activity

Stars

7 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.