メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

ReCAPTCHA::__construct

Set the reCAPTCHA secret key and score threshold

Description​

public ReCAPTCHA::__construct( string $secret, [ float $threshold = 0.5 ] )

Arguments​

NameData typeDefaultRemarks
$secretstringreCAPTCHA secret key. Read it from site/config/env.php with feggEnv('FEGG_RECAPTCHA_SECRET')
$thresholdfloat0.5Minimum score (0.0 to 1.0) / a lower score fails ReCAPTCHA::auth

Example​

Controller
use Fegg\Captcha\ReCAPTCHA;

$recaptcha = new ReCAPTCHA(feggEnv('FEGG_RECAPTCHA_SECRET', ''), 0.5);