Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Captcha
+ Graphe d'héritage de Captcha:

Fonctions membres publiques

 __construct ($captcha, $options)
 
 initialise ($id)
 
 display ($name, $id, $class='')
 
 checkAnswer ($code)
 
 setupField (\Joomla\CMS\Form\Field\CaptchaField $field, \SimpleXMLElement $element)
 
 getState ()
 
 attach ($observer)
 
 detach ($observer)
 

Fonctions membres publiques statiques

static getInstance ($captcha, array $options=array())
 

Attributs protégés

 $_observers = array()
 
 $_state = null
 
 $_methods = array()
 

Fonctions membres privées

 _load (array $options=array())
 

Attributs privés

 $_captcha
 
 $_name
 

Attributs privés statiques

static $_instances = array()
 

Description détaillée

Joomla! Captcha base object

Depuis
2.5

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $captcha,
  $options 
)

Class constructor.

Paramètres
string$captchaThe plugin to use.
array$optionsAssociative array of options.
Depuis
2.5
Exceptions

Références $options.

Documentation des fonctions membres

◆ _load()

_load ( array  $options = array())
private

Load the Captcha plugin.

Paramètres
array$optionsAssociative array of options.
Renvoie
void
Depuis
2.5
Exceptions

Références $name, $options, $params, $path, PluginHelper\getPlugin(), et JPATH_PLUGINS.

◆ attach()

attach (   $observer)

Attach an observer object

Paramètres
object$observerAn observer object to attach
Renvoie
void
Depuis
2.5

Références $check, $class, et $key.

◆ checkAnswer()

checkAnswer (   $code)

Checks if the answer is correct.

Paramètres
string$codeThe answer.
Renvoie
bool Whether the provided answer was correct
Depuis
2.5
Exceptions

Références null.

◆ detach()

detach (   $observer)

Detach an observer object

Paramètres
object$observerAn observer object to detach.
Renvoie
boolean True if the observer object was detached.
Depuis
2.5

Références $key.

◆ display()

display (   $name,
  $id,
  $class = '' 
)

Get the HTML for the captcha.

Paramètres
string$nameThe control name.
string$idThe id for the control.
string$classValue for the HTML class attribute
Renvoie
mixed The return value of the function "onDisplay" of the selected Plugin.
Depuis
2.5
Exceptions

Références $class, $id, $name, et null.

◆ getInstance()

static getInstance (   $captcha,
array  $options = array() 
)
static

Returns the global Captcha object, only creating it if it doesn't already exist.

Paramètres
string$captchaThe plugin to use.
array$optionsAssociative array of options.
Renvoie
Captcha|null Instance of this class.
Depuis
2.5
Exceptions

Références $options.

Référencé par CaptchaField\setup(), et CaptchaRule\test().

◆ getState()

getState ( )

Get the state of the Captcha object

Renvoie
mixed The state of the object.
Depuis
2.5

◆ initialise()

initialise (   $id)

Fire the onInit event to initialise the captcha plugin.

Paramètres
string$idThe id of the field.
Renvoie
boolean True on success
Depuis
2.5
Exceptions

Références $id.

◆ setupField()

setupField ( \Joomla\CMS\Form\Field\CaptchaField  $field,
\SimpleXMLElement  $element 
)

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.

Paramètres
\Joomla\CMS\Form\Field\CaptchaField$fieldCaptcha field instance
\SimpleXMLElement$elementXML form definition
Renvoie
void

Références $field, et null.

Documentation des champs

◆ $_captcha

$_captcha
private

◆ $_instances

$_instances = array()
staticprivate

◆ $_methods

$_methods = array()
protected

◆ $_name

$_name
private

◆ $_observers

$_observers = array()
protected

◆ $_state

$_state = null
protected

La documentation de cette classe a été générée à partir du fichier suivant :