jbennecker/silverstripe-recaptcha 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jbennecker/silverstripe-recaptcha

最新稳定版本:v4.0.0

Composer 安装命令:

composer require jbennecker/silverstripe-recaptcha

包简介

SilverStripe module for ReCaptcha 2.0 spam protection

README 文档

README

Introduction

This module adds a RecaptchaField to SilverStripe 4.x, which you can use in custom forms.

Install

composer require jbennecker/silverstripe-recaptcha

Usage

Put your keys in app/_config/app.yml

jbennecker\recaptcha\Forms\RecaptchaField:
  public_api_key: "public key"
  private_api_key: "private key"

Then you can use the Field in your forms.

    public function HelloForm()
    {
        $fields = new FieldList(
            TextField::create('Name', _t('HelloForm.Name', 'Name')),
            TextField::create('Email', _t('HelloForm.Email', 'E-Mail')),
            TextareaField::create('Nachricht', _t('HelloForm.Nachricht', 'Nachricht')),
            RecaptchaField::create('recaptcha') // <--- add this
        );

        $actions = new FieldList(
            FormAction::create('doSayHello')->setTitle(_t('HelloForm.Submit', 'Senden'))
        );

        $required = new RequiredFields('Name', 'Email', 'Nachricht');

        $form = new Form($this, 'HelloForm', $fields, $actions, $required);

        return $form;
    }

统计信息

  • 总下载量: 3.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-22