blueweb/nette-honeypot

Honeypot extension for Nette Forms

2.0.1 2023-09-19 08:17 UTC

This package is auto-updated.

Last update: 2024-11-09 12:37:07 UTC


README

Adds support for honeypot input in Nette Forms.

Installation

Best way to install this is using composer:

composer require blueweb/nette-honeypot

Then register extension:

extensions:
    honeypot: Blueweb\NetteHoneypot\HoneypotExtension

Usage

$form->addHoneypot($name, $caption, $errorMessage);

Parameter $name should be something yummy for robot, like additional_email.

In $caption you should write something for user, which for some reason has not this field hidden.

In $message you may change default error message.

You can also specify your own error callback:

$honeypot = $form->addHoneypot('email');
$honeypot->onError[] = function($control){ .... };