PHP Class RecaptchaHelper

Inheritance: extends AppHelper
Datei anzeigen Open project: cakedc/recaptcha

Public Properties

Property Type Description
$apiUrl string API Url
$helpers array View helpers

Protected Properties

Property Type Description
$callback string Callback function name (fot explicit rendering)
$explicit array Items to render explicitly

Public Methods

Method Description
afterRender ( $viewFile )
display ( array $options = [] ) : string Displays the Recaptcha input
mailHide ( string $email ) : string Gets html to display an email address given a public an private key to get a key go to: https://www.google.com/recaptcha/mailhide/apikey
mailHideUrl ( string $email = null ) : string Gets the reCAPTCHA Mailhide url for a given email
signupUrl ( string $appName = null ) : string Recaptcha signup URL

Private Methods

Method Description
__aesEncrypt ( string $value, string $key ) : string AES Encryption
__aesPad ( string $val ) : string AES Pad
__hideEmailParts ( string $email ) : array Get a part of the email to show
__mailhideUrlbase64 ( string $x ) : string Mail-hide URL

Method Details

afterRender() public method

public afterRender ( $viewFile )

display() public method

Displays the Recaptcha input
public display ( array $options = [] ) : string
$options array An array of options ### Options: - `element` String, name of the view element that can be used instead of the hardcoded HTML structure from this helper - `explicit` reCAPTCHA rendering method. Set to true when rendering multiple reCAPTCHAs on a page - `error` String, optional error message that is displayed using Form::error() - `div` Array of options for the div tag the recaptcha is wrapped with, set to false if you want to disable it - `lang` Forces the widget to render in a specific language - `recaptchaOptions` assoc array of options to pass into RecaptchaOptions var, like 'sitekey' (default is read from Configure::read('Recaptcha.publicKey')), 'theme', 'type', 'size.
return string The resulting mark up

mailHide() public method

Gets html to display an email address given a public an private key to get a key go to: https://www.google.com/recaptcha/mailhide/apikey
public mailHide ( string $email ) : string
$email string An email address
return string

mailHideUrl() public method

Gets the reCAPTCHA Mailhide url for a given email
public mailHideUrl ( string $email = null ) : string
$email string An email address
return string

signupUrl() public method

Recaptcha signup URL
public signupUrl ( string $appName = null ) : string
$appName string An application name
return string A signup url

Property Details

$apiUrl public_oe property

API Url
public string $apiUrl
return string

$callback protected_oe property

Callback function name (fot explicit rendering)
protected string $callback
return string

$explicit protected_oe property

Items to render explicitly
protected array $explicit
return array

$helpers public_oe property

View helpers
public array $helpers
return array