Download the PHP package linjialiang/tp6-captcha without Composer
On this page you can find all versions of the php package linjialiang/tp6-captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download linjialiang/tp6-captcha
More information about linjialiang/tp6-captcha
Files in linjialiang/tp6-captcha
Download linjialiang/tp6-captcha
More information about linjialiang/tp6-captcha
Files in linjialiang/tp6-captcha
Vendor linjialiang
Package tp6-captcha
Short Description The Captcha class library for ThinkPHP 6.0, which relies on php_Imagick
License Apache-2.0
Package tp6-captcha
Short Description The Captcha class library for ThinkPHP 6.0, which relies on php_Imagick
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package tp6-captcha
tp6-captcha
thinkphp6 验证码类库
安装
composer require linjialiang/tp6-captcha
使用
启用 Session
ThinkPHP 6.0 下 Session
功能默认是没有开启的(API 通常不需要),如需开启可在 全局中间件定义文件
中加上下面的定义:
在控制器中输出验证码
在控制器的操作方法中使用
然后注册对应的路由来输出验证码
模板里输出验证码
首先要在你应用的路由定义文件中,注册一个验证码路由规则。
然后就可以在模板文件中使用
或者
上面两种的最终效果是一样的
控制器里验证
使用 TP 的内置验证功能即可
或者手动验证
字符说明
默认字体,支持的字符有限,如需增加其它字符请重新载入字体:
目录 | 描述 |
---|---|
assets/fonts@default | 常规字符集 |
assets/fonts@zh | 中文字符集 |
assets/fonts@math | 算术字符集 |
assets/fonts@source | FontForge 字体文件 |
assets/bgs | 验证码背景图 |
支持的字体类型
支持 3 种类型的字体: ttf
、 ttc
、 otc
字符集内容:
-
中文字符集
-
常规字符集
- math 字符集
参考来源
tp6-captcha 灵感来自 thinkphp 官方验证码类库,操作上与其基本一致!
All versions of tp6-captcha with dependencies
PHP Build Version
Package Version
The package linjialiang/tp6-captcha contains the following files
Loading the files please wait ....