elmnsk / yii2-honeypot
Protects forms from spam using 'honeypot' method
Installs: 2 021
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.6
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2025-06-26 17:41:41 UTC
README
Protects the forms from spam using "honeypot" method
Installation
The preferred way to install this extension is through composer.
Use composer
composer require --prefer-dist elmnsk/yii2-honeypot "*"
or add
"elmnsk/yii2-honeypot": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
//model property public $honeypotTime; //in model rules ['honeypotTime',\elmnsk\yii2honeypot\HoneypotTimeValidator::class,'time'=>10];
<?=$form->field($model,'honeypotTime') ->widget(\elmnsk\yii2honeypot\HoneypotTimeWidget::class)->label(false);?>
'time' - this is the time in seconds, less than which the form submission will be detected as spam