siezi/cakephp-simple-captcha 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

siezi/cakephp-simple-captcha

最新稳定版本:1.0.0

Composer 安装命令:

composer require siezi/cakephp-simple-captcha

包简介

Simple Captcha Plugin for CakePHP

README 文档

README

Simple captcha plugin for CakePHP. Presents a text field with a simple math problem (plus some invisible checks).

See: https://github.com/Schlaefer/cakephp-simple-captcha

Install

composer require siezi/cakephp-simple-captcha

Include plugin Cake 4 style:

$this->addPlugin(\Siezi\SimpleCaptcha\Plugin::class);

Usage Example

Insert Captcha-Field in Template

Load the helper CakePHP 4 style:

$this->loadHelper('Siezi/SimpleCaptcha.SimpleCaptcha');

In template form:

echo $this->SimpleCaptcha->control();

Validate Captcha in Controller

$validator = new \Siezi\SimpleCaptcha\Model\Validation\SimpleCaptchaValidator();
$errors = $validator->validate($this->request->getData());

Depending on the form you may want to merge the captcha-errors so they are displayed automatically with other form validation errors. For example if the form is backed by a user-entity:

$yourUserEntity->setErrors($errors);

统计信息

  • 总下载量: 4.29k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 141
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-25