Abstract base for CAPTCHA implementations.

package XenForo_Captcha

 Methods

To string method to warn if the CAPTCHA hasn't been rendered properly.

__toString() : string

Returns

string

Creates the default CAPTCHA handler.

createDefault(boolean $alwaysCreate) : \XenForo_Captcha_Abstract | false

By default, this checks whether a CAPTCHA is needed for the visiting user. Note that you can never guarantee that this function will return an object!

Parameters

$alwaysCreate

boolean

If false, creates if visiting user needs; otherwise, creates the default object if configured

Returns

Determines if the CAPTCHA has been passed.

isValid(array $input) : boolean

Parameters

$input

array

Set of input to validate against

Returns

boolean

render()

render(\XenForo_View $view) 

Parameters

$view

Renders the CAPTCHA for use in a template.

renderInternal(\XenForo_View $view) : \XenForo_Template_Abstract | string

This should only render the CAPTCHA area itself. The CAPTCHA may be used in a form row or own its own.

Parameters

Returns

Validates the default CAPTCHA handler.

validateDefault(array | \XenForo_Input $input, boolean $alwaysCheck) : boolean

Parameters

$input

array\XenForo_Input

Input to check

$alwaysCheck

boolean

If true, always checks; if false, checks if visiting user needs

Returns

boolean

 Properties

 

Rendered output cache.

$_rendered : \XenForo_Template_Abstract | string | null