panlatent/craft-geetest

Geetest plugin for Craft 3

0.2.0 2018-09-22 15:51 UTC

This package is auto-updated.

Last update: 2024-12-23 06:17:58 UTC


README

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License Craft CMS Yii2

Screenshot

Geetest plugin for Craft 3. Geetest 极验 provides a robust human-machine verification solution. This plugin provides these features for Craft.

Features

  • Captcha

Requirements

This plugin requires Craft CMS 3.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require panlatent/craft-geetest
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Geetest.

Usage

  1. Set Plugin Setting: Access ID and Access Key

  2. Add to a template:

{{ geetestInput() }}

Notice: Don't forget CSRF verification {{ csrfInput() }}.

  1. Validate in a controller:
public function actionRegister()
{
    \panlatent\craft\geetest\helpers\Getest::requireValidated();
    
    // or
    
    $isValid = \panlatent\craft\geetest\helpers\Getest::isValidated();
}

Documentation

Documentation