camspiers / honeypot
此软件包最新版本(3.0.0)没有可用的许可信息。
3.0.0
2019-08-14 03:01 UTC
Requires
- composer/installers: ~1.0
- silverstripe/spamprotection: ~3.0.0
README
camspiers/honeypot的SilverStripe 4.x兼容版本
安装(使用composer)
$ composer require heyday/silverstripe-honeypot
在 app/_config/spamprotection.yml 中设置默认垃圾邮件防护器
---
name: spamprotection
---
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension:
default_spam_protector: Heyday\SilverStripe\HoneyPot\HoneyPotSpamProtector
或者,根据表单设置
use Heyday\SilverStripe\HoneyPot\HoneyPotField;
use SilverStripe\Forms\Form;
use SilverStripe\Control\Controller;
use SilverStripe\Forms\FieldList;
/**
* Class SomeForm
*/
class SomeForm extends Form
{
/**
* @param Controller $controller
*/
public function __construct(Controller $controller)
{
$fields = new FieldList();
$fields->push(new HoneyPotField('Website')); // 'Website' here can be any old string
...
}
}