camspiers/honeypot

此软件包最新版本(3.0.0)没有可用的许可信息。

安装次数: 47,395

依赖关系: 0

建议者: 0

安全性: 0

星标: 7

关注者: 3

分支: 14

开放问题: 5

类型:silverstripe-vendormodule

3.0.0 2019-08-14 03:01 UTC

This package is auto-updated.

Last update: 2024-09-19 11:29:48 UTC


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
        ...
    }
}