Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
MoodleQuickForm_recaptcha Class Reference

recaptcha type form element More...

Inheritance diagram for MoodleQuickForm_recaptcha:
templatable

Public Member Functions

 __construct ($elementName=null, $elementLabel=null, $attributes=null)
 constructor
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template.
 
 get_force_ltr ()
 Get force LTR option.
 
 getHelpButton ()
 get html for help button
 
 MoodleQuickForm_recaptcha ($elementName=null, $elementLabel=null, $attributes=null)
 Old syntax of class constructor.
 
 toHtml ()
 Returns the reCAPTCHA element in HTML.
 
 verify ($responsestr)
 Checks recaptcha response with Google.
 

Public Attributes

string $_helpbutton =''
 html for help button, if empty then no help
 

Detailed Description

recaptcha type form element

HTML class for a recaptcha type element

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

MoodleQuickForm_recaptcha::__construct ( $elementName = null,
$elementLabel = null,
$attributes = null )

constructor

Parameters
string$elementName(optional) name of the recaptcha element
string$elementLabel(optional) label for recaptcha element
mixed$attributes(optional) Either a typical HTML attribute string or an associative array

Member Function Documentation

◆ export_for_template()

MoodleQuickForm_recaptcha::export_for_template ( renderer_base $output)

Function to export the renderer data in a format that is suitable for a mustache template.

This means:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implements templatable.

◆ get_force_ltr()

MoodleQuickForm_recaptcha::get_force_ltr ( )

Get force LTR option.

Return values
bool

◆ getHelpButton()

MoodleQuickForm_recaptcha::getHelpButton ( )

get html for help button

Return values
stringhtml for help button

◆ MoodleQuickForm_recaptcha()

MoodleQuickForm_recaptcha::MoodleQuickForm_recaptcha ( $elementName = null,
$elementLabel = null,
$attributes = null )

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated
since Moodle 3.1

◆ toHtml()

MoodleQuickForm_recaptcha::toHtml ( )

Returns the reCAPTCHA element in HTML.

Return values
stringThe HTML to render

◆ verify()

MoodleQuickForm_recaptcha::verify ( $responsestr)

Checks recaptcha response with Google.

Parameters
string$responsestr
Return values
bool

The documentation for this class was generated from the following file: