zsr集团/zf2nocaptcha

Google NoCaptcha for Laminas

v0.4 2022-11-22 13:15 UTC

This package is not auto-updated.

Last update: 2024-09-22 07:59:07 UTC


README

此Laminas Captcha适配器使用Google的reCAPTCHA php库(见此处:https://github.com/google/recaptcha)。

##用法

  • 通过composer获取
composer require srggroup/zf2nocaptcha
  • 在您的Laminas模块配置中定义助手
'view_helpers'=>array(
	'invokables'=>array(
		'recaptcha.helper'=>'NoCaptcha\NoCaptchaHelper'
	)
)
  • 将其集成到表单中,就像标准的laminas recaptcha元素一样
$adapter = new \NoCaptcha\NoCaptchaAdapter($siteKey, $secreteKey);

我使用了此存储库中的一些代码: https://github.com/szmnmichalowski/ZF2-NoCaptcha