X3dgoo\HCaptcha\Forms\HCaptchaField
Synopsis
class HCaptchaField
extends FormField
{
- // members
- private static $site_key;
- private static $secret_key;
- protected $_siteKey;
- protected $_secretKey;
- private static string $default_theme = 'light';
- private $_captchaTheme;
- // methods
- public void __construct()
- public DBHTMLText Field()
- public bool validate()
- private bool processCaptcha()
- public string getSiteKey()
- private string getSecretKey()
- public void setSiteKey()
- public void setSecretKey()
- public string getFormID()
- public NocaptchaField setTheme()
- public string getCaptchaTheme()
Hierarchy
Extends
- SilverStripe\Forms\FormField
Members
private
- $_captchaTheme
—
string
Captcha theme, currently options are light and dark - $default_theme
—
string
Captcha theme, currently options are light and dark -
$secret_key
HCaptcha Secret Key -
$site_key
HCaptcha Site Key
protected
-
$_secretKey
HCaptcha Site Key Configurable via Injector config -
$_siteKey
HCaptcha Site Key Configurable via Injector config
Methods
private
- getSecretKey() — Gets the secret key configured via HCaptchaField.secret_key
- processCaptcha() — Validates the captcha against the hCaptcha API
public
- __construct() — Creates a new HCaptcha field.
- Field() — Adds in the requirements for the field
- getCaptchaTheme() — Gets the theme for this captcha
- getFormID() — Gets the form's id
- getSiteKey() — Gets the site key configured via HCaptchaField.site_key this is used in the template
- setSecretKey() — Setter for _secretKey to allow injector config to override the value
- setSiteKey() — Setter for _siteKey to allow injector config to override the value
- setTheme() — Sets the theme for this captcha
- validate() — Validates the captcha against the hCaptcha API