PHP Class RecaptchaComponent

Inheritance: extends Component
Afficher le fichier Open project: cakedc/recaptcha

Méthodes publiques

Свойство Type Description
$Controller string Name
$actions array Actions that should automatically checked for a recaptcha input
$apiUrl string Recaptcha API Url
$error string Error coming back from Recaptcha
$privateKey string Private API Key
$settings array Settings

Protected Properties

Свойство Type Description
$_defaults array Default Options

Méthodes publiques

Méthode Description
__construct ( ComponentCollection $collection, array $settings = [] ) : RecaptchaComponent Constructor
initialize ( Controller $controller, array $settings = [] ) : void Callback
startup ( Controller $controller ) : void Callback
verify ( ) : boolean Verifies the recaptcha input

Méthodes protégées

Méthode Description
_getApiResponse ( ) : HttpSocketResponse Queries the Recaptcha API and and returns the raw response

Method Details

__construct() public méthode

Constructor
public __construct ( ComponentCollection $collection, array $settings = [] ) : RecaptchaComponent
$collection ComponentCollection A ComponentCollection this component can use to lazy load its components
$settings array Array of configuration settings
Résultat RecaptchaComponent

_getApiResponse() protected méthode

Queries the Recaptcha API and and returns the raw response
protected _getApiResponse ( ) : HttpSocketResponse
Résultat HttpSocketResponse

initialize() public méthode

Callback
public initialize ( Controller $controller, array $settings = [] ) : void
$controller Controller Controller with components to initialize
$settings array Array of configuration settings
Résultat void

startup() public méthode

Callback
public startup ( Controller $controller ) : void
$controller Controller Controller with components to initialize
Résultat void

verify() public méthode

Please note that you still have to pass the result to the model and do the validation there to make sure the data is not saved!
public verify ( ) : boolean
Résultat boolean True if the response was correct

Property Details

$Controller public_oe property

Name
public string $Controller
Résultat string

$_defaults protected_oe property

Default Options
protected array $_defaults
Résultat array

$actions public_oe property

Actions that should automatically checked for a recaptcha input
public array $actions
Résultat array

$apiUrl public_oe property

Recaptcha API Url
public string $apiUrl
Résultat string

$error public_oe property

Error coming back from Recaptcha
public string $error
Résultat string

$privateKey public_oe property

Private API Key
public string $privateKey
Résultat string

$settings public_oe property

Settings
public array $settings
Résultat array