wodcz/nette-honeypot
Composer 安装命令:
composer require wodcz/nette-honeypot
包简介
Honeypot extension for Nette Forms
README 文档
README
Adds support for honeypot input in Nette Forms.
What it does
TLDR; It creates form input, then hides it using CSS or JS. Spam bots usually fill all fields (especially those with yummy names, like 'email' or 'web'). Human will not fill hidden field, so this is a way to detect bot, instead of forcing user to solve captcha.
Installation
Best way to install this is using composer:
composer require wodcz/nette-honeypot
Then register extension:
extensions:
honeypot: wodCZ\NetteHoneypot\HoneypotExtension
Usage
$form->addHoneypot($name, $caption, $errorMessage, $mode);
$name should be something yummy for robot, like 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.
And $mode should be one of wodCZ\NetteHoneypot\Honeypot::MODE_CSS or MODE_JS.
You can also specify your own error callback:
$honeypot = $form->addHoneypot('email');
$honeypot->onError[] = function($control){ .... };
Configuring
honeypot:
inline: true/false # if true, extension will append css/js (according to mode) right after input. Otherwise you have to link css/js on your own.
统计信息
- 总下载量: 37.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: 0BSD
- 更新时间: 2015-03-27