Back to Joomla project (class list)

Class Captcha - list of methods

Joomla! Captcha base object
Package: Joomla\CMS\Captcha
Copyright: (C) 2011 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Captcha/Captcha.php
Project: Joomla

Method Summary

public
(mixed $captcha, mixed $options)

Class constructor.
Parameters
  • string $captcha The plugin to use.
  • array $options Associative array of options.
Since
  • 2.5
-
  • \RuntimeException
Show source code of this method: __construct Source Code

public static \Joomla\CMS\Captcha\Captcha|null
(mixed $captcha, array $options = array())

Returns the global Captcha object, only creating it if it doesn't already exist.
Parameters
  • string $captcha The plugin to use.
  • array $options Associative array of options.
Returns
  • \Joomla\CMS\Captcha\Captcha|null Instance of this class.
Since
  • 2.5
-
  • \RuntimeException
Show source code of this method: getInstance Source Code

public bool
(mixed $id)

Fire the onInit event to initialise the captcha plugin.
Parameters
  • string $id The id of the field.
Returns
  • bool True on success
Since
  • 2.5
-
  • \RuntimeException
Show source code of this method: initialise Source Code

public string
(mixed $name, mixed $id, mixed $class = '')

Get the HTML for the captcha.
Parameters
  • string $name The control name.
  • string $id The id for the control.
  • string $class Value for the HTML class attribute
Returns
  • string The return value of the function "onDisplay" of the selected Plugin.
Since
  • 2.5
-
  • \RuntimeException
Show source code of this method: display Source Code

public bool
(mixed $code)

Checks if the answer is correct.
Parameters
  • string $code The answer.
Returns
  • bool Whether the provided answer was correct
Since
  • 2.5
-
  • \RuntimeException
Show source code of this method: checkAnswer Source Code

public void
(\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.
Parameters
  • \Joomla\CMS\Form\Field\CaptchaField $field Captcha field instance
  • \SimpleXMLElement $element XML form definition
Returns
  • void
Show source code of this method: setupField Source Code

private mixed
(mixed $name, mixed &$args)

Method to call the captcha callback if it exist.
Parameters
  • string $name Callback name
  • array & $args Arguments
Returns
  • mixed
Since
  • 4.0.0
Show source code of this method: update Source Code

private void
(array $options = array())

Load the Captcha plugin.
Parameters
  • array $options Associative array of options.
Returns
  • void
Since
  • 2.5
-
  • \RuntimeException
Show source code of this method: _load Source Code

Properties Summary

private \Joomla\CMS\Plugin\CMSPlugin
$captcha
Captcha Plugin object
Since
  • 2.5
private string
$name
Editor Plugin name
Since
  • 2.5
private static \Joomla\CMS\Captcha\Captcha[]
$instances
Array of instances of this class.
Since
  • 2.5

Tags Summary

Since
2.5