Captcha
Implements DispatcherAwareInterfaceJoomla! Captcha base object
| abstract | |
|---|---|
| since |
2.5 |
| package |
Joomla CMS |
Methods
__construct
Class constructor.
__construct( captcha, mixed||string|int options) :
| since |
2.5 |
|---|---|
| throws |
|
Arguments
- captcha
stringThe plugin to use.- options
array<string|int, mixed>Associative array of options.
Response
mixed
_load
Load the Captcha plugin.
_load(mixed||string|int options = []) :
| since |
2.5 |
|---|---|
| throws |
|
Arguments
- options
array<string|int, mixed>Associative array of options.
Response
void
checkAnswer
Checks if the answer is correct.
checkAnswer( code) :
| since |
2.5 |
|---|---|
| throws |
|
Arguments
- code
stringThe answer.
Response
boolWhether the provided answer was correct
display
Get the HTML for the captcha.
display( name, id, class = '') :
| since |
2.5 |
|---|---|
| throws |
|
Arguments
- name
stringThe control name.- id
stringThe id for the control.- class
stringValue for the HTML class attribute
Response
stringThe return value of the function "onDisplay" of the selected Plugin.
getInstance
Returns the global Captcha object, only creating it if it doesn't already exist.
getInstance( captcha, mixed||string|int options = []) : \Joomla\CMS\Captcha\Captcha|null
| since |
2.5 |
|---|---|
| throws |
|
Arguments
- captcha
stringThe plugin to use.- options
array<string|int, mixed>Associative array of options.
Response
Captcha|nullInstance of this class.
initialise
Fire the onInit event to initialise the captcha plugin.
initialise( id) :
| since |
2.5 |
|---|---|
| throws |
|
Arguments
- id
stringThe id of the field.
Response
boolTrue on success
setupField
Method to react on the setup of a captcha field. Gives the possibility to change the field and/or the XML element for the field.
setupField(\Joomla\CMS\Form\Field\CaptchaField field, \SimpleXMLElement element) :
Arguments
- field
CaptchaFieldCaptcha field instance- element
SimpleXMLElementXML form definition
Response
void
update
Method to call the captcha callback if it exist.
update( name, mixed||string|int &args) :
| since |
4.0.0 |
|---|
Arguments
- name
stringCallback name- args
array<string|int, mixed>Arguments
Response
mixed
Properties
name
Editor Plugin name
| since |
2.5 |
|---|
Type(s)
string