# think-qrcode **Repository Path**: weifashi/think-qrcode ## Basic Information - **Project Name**: think-qrcode - **Description**: ........... - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-11-30 - **Last Updated**: 2022-11-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # think-qrcode The ThinkPHP6.1 qrcode 二维码生成 SDK ## 安装 ### 一、执行命令安装 ``` composer require weifashi/think-qrcode ``` 或者 ### 二、require安装 ##### thinkphp5.1 安装 ``` "require": { "weifashi/think-qrcode":"2.*" }, ``` ## 使用 #### 添加配置文件 ``` return [ 'cache_dir' => 'uploads'.DS.'qrcode', //缓存地址 'background'=> 'static/image/icon_cover.png' //背景图 ]; ``` #### 使用方法 ``` $code = new QRcode(); $code_path = $code->png($register_url) //生成二维码 ->logo('static/image/avatar-m.jpg') //生成logo二维码 ->background(180,500) //给二维码加上背景 ->text($role,20,['center',740],'#ff4351') //添加文字水印 ->text($nick_name,20,['center',780],'#000000') ->getPath(); //获取二维码生成的地址 ```