fm-labs / cakephp-captcha
该软件包最新版本(1.2.1)没有提供许可信息。
CakePHP Captcha 插件
1.2.1
2023-03-14 12:53 UTC
Requires
- php: >=7.2
- dapphp/securimage: ^3.6.7
This package is auto-updated.
Last update: 2024-09-14 16:07:19 UTC
README
一个易于使用的 CakePHP 框架 Captcha 插件,使用Securimage PHP Captcha 库
安装
添加到你的 composer.json 文件中
{
"require": {
"fm-labs/cakephp-captcha": "dev-master"
}
}
或者运行
$ composer require fm-labs/cakephp-captcha
快速设置
-
启用插件
//文件: config/bootstrap.php
Plugin::load('Captcha', ['bootstrap' => true, 'routes' => true]);
-
在表单中使用 CaptchaWidget
//文件: 在任何视图模板 $this->loadHelper('Captcha.Captcha');
$this->Form->create(null); $this->Form->input('captcha', ['type' => 'captcha']]); //$this->Captcha->input('captcha'); //旧/过时的方法 $this->Form->submit(); $this->Form->end();