Back to Captcha class

Method __construct

public
__construct
(mixed $captcha, mixed $options)
Class constructor.
Parameters
  • string $captcha The plugin to use.
  • array $options Associative array of options.
Since
  • 2.5
-
  • \RuntimeException
Class: Captcha
Project: Joomla

Method __construct - Source code

/**
 * Class constructor.
 *
 * @param   string  $captcha  The plugin to use.
 * @param   array   $options  Associative array of options.
 *
 * @since   2.5
 * @throws  \RuntimeException
 */
public function __construct($captcha, $options)
{
    $this->name = $captcha;
    if (!empty($options['dispatcher']) && $options['dispatcher'] instanceof DispatcherInterface) {
        $this->setDispatcher($options['dispatcher']);
    } else {
        $this->setDispatcher(Factory::getApplication()->getDispatcher());
    }
    $this->_load($options);
}