Geetest plugin for Craft 3. Geetest 极验 provides a robust human-machine verification solution. This plugin provides these features for Craft.
- Captcha
This plugin requires Craft CMS 3.0 or later.
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require panlatent/craft-geetest
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Geetest.
-
Set Plugin Setting: Access ID and Access Key
-
Add to a template:
{{ geetestInput() }}
Notice: Don't forget CSRF verification {{ csrfInput() }}
.
- Validate in a controller:
public function actionRegister()
{
\panlatent\craft\geetest\helpers\Getest::requireValidated();
// or
$isValid = \panlatent\craft\geetest\helpers\Getest::isValidated();
}