Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

(no description)

File Size: 268 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

HTML_QuickForm_radio:: (2 methods):
  __construct()
  HTML_QuickForm_radio()

name:: (9 methods):
  _generateId()
  setChecked()
  getChecked()
  toHtml()
  getFrozenHtml()
  setText()
  getText()
  onQuickFormEvent()
  exportValue()


Class: HTML_QuickForm_radio  - X-Ref

HTML class for a radio type element

__construct($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null)   X-Ref
Class constructor

param: string    Input field name attribute
param: mixed     Label(s) for a field
param: string    Text to display near the radio
param: string    Input field value
param: mixed     Either a typical HTML attribute string or an associative array
return: void

HTML_QuickForm_radio($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null)   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


Class: name  - X-Ref

_generateId()   X-Ref
No description

setChecked($checked)   X-Ref
Sets whether radio button is checked

param: bool    $checked  Whether the field is checked or not
return: void

getChecked()   X-Ref
Returns whether radio button is checked

return: string

toHtml()   X-Ref
Returns the radio element in HTML

return: string

getFrozenHtml()   X-Ref
Returns the value of field without HTML tags

return: string

setText($text)   X-Ref
Sets the radio text

param: string    $text  Text to display near the radio button
return: void

getText()   X-Ref
Returns the radio text

return: string

onQuickFormEvent($event, $arg, &$caller)   X-Ref
Called by HTML_QuickForm whenever form event is made on this element

param: string    $event  Name of event
param: mixed     $arg    event arguments
param: object    $caller calling object
return: void

exportValue(&$submitValues, $assoc = false)   X-Ref
Returns the value attribute if the radio is checked, null if it is not