Captcha
Extends \JObjectJoomla! Captcha base object
abstract | |
---|---|
since |
2.5 |
Methods
__construct
Class constructor.
__construct(string $captcha, array $options)
since |
2.5 |
---|---|
throws |
|
Arguments
- $captcha
string
The plugin to use.- $options
array
Associative array of options.
_load
Load the Captcha plugin.
_load(array $options = array()) : void
since |
2.5 |
---|---|
throws |
|
Arguments
- $options
array
Associative array of options.
attach
Attach an observer object
attach(object $observer) : void
since |
2.5 |
---|
Arguments
- $observer
object
An observer object to attach
checkAnswer
Checks if the answer is correct.
checkAnswer(string $code) : boolean
since |
2.5 |
---|---|
throws |
|
Arguments
- $code
string
The answer.
Response
boolean
Whether the provided answer was correct
detach
Detach an observer object
detach(object $observer) : boolean
since |
2.5 |
---|
Arguments
- $observer
object
An observer object to detach.
Response
boolean
True if the observer object was detached.
display
Get the HTML for the captcha.
display(string $name, string $id, string $class = '') : mixed
since |
2.5 |
---|---|
throws |
|
Arguments
- $name
string
The control name.- $id
string
The id for the control.- $class
string
Value for the HTML class attribute
Response
mixed
The 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(string $captcha, array $options = array()) : \Joomla\CMS\Captcha\Captcha|null
since |
2.5 |
---|---|
throws |
|
Arguments
- $captcha
string
The plugin to use.- $options
array
Associative array of options.
Response
\Joomla\CMS\Captcha\Captcha|null
Instance of this class.
getState
Get the state of the Captcha object
getState() : mixed
since |
2.5 |
---|
Response
mixed
The state of the object.
initialise
Fire the onInit event to initialise the captcha plugin.
initialise(string $id) : boolean
since |
2.5 |
---|---|
throws |
|
Arguments
- $id
string
The id of the field.
Response
boolean
True 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) : void
Arguments
- $field
\Joomla\CMS\Form\Field\CaptchaField
Captcha field instance- $element
\SimpleXMLElement
XML form definition
Properties
_observers
An array of Observer objects to notify
since |
2.5 |
---|
Type(s)
array
_state
The state of the observable object
since |
2.5 |
---|
Type(s)
mixed
_methods
A multi dimensional array of [function][] = key for observers
since |
2.5 |
---|
Type(s)
array
_name
Editor Plugin name
since |
2.5 |
---|
Type(s)
string
_instances
Array of instances of this class.