domingosjunior87 / honeypot-captcha
Plugin for CakePHP 2.x to use a Honeypot Captcha
Installs: 881
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Type:cakephp-plugin
Requires
- cakephp/cakephp: 2.*
- composer/installers: ~1.0
This package is not auto-updated.
Last update: 2025-06-22 08:18:18 UTC
README
Plugin for CakePHP 2.x to use a Honeypot Captcha
Requirements
- PHP 5.3+
- CakePHP 2.X
Installation
In your app directory type
composer require domingosjunior87/honeypot-captcha
Setup
In app/Config/bootstrap.php add:
CakePlugin::load('HoneypotCaptcha');
Usage
In controller, import the component and the helper, like this:
public $components = array( 'HoneypotCaptcha.Honeypot' => array( 'text' => array('email_user', 'email_admin'), 'checkbox' => array('validate_submit', 'validate_form'), 'hidden' => array('phone_number'), 'errorMessage' => "Error message" ) ); public $helpers = array('HoneypotCaptcha.Honeypot');
In view, just put this, inside a form tag:
echo $this->Honeypot->render();
When submit the form, validate data:
if (!$this->Honeypot->validate()) { return $this->redirect(array('action' => 'index')); }