Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | List of all members
MoodleQuickForm_recaptcha Class Reference
Inheritance diagram for MoodleQuickForm_recaptcha:
templatable

Public Member Functions

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

Public Attributes

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

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: