Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 403]

Radio input form element.

Copyright: 2013 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 91 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/behat/form_field/behat_form_checkbox.php

Defines 1 class

behat_form_radio:: (2 methods):
  get_value()
  set_value()


Class: behat_form_radio  - X-Ref

Radio input form field.

Extends behat_form_checkbox as the set_value() behaviour
is the same and it behaves closer to a checkbox than to
a text field.

This form field type can be added to forms as any other
moodle form element, but it does not make sense without
a group of radio inputs, so is hard to find it alone and
detect it by behat_field_manager::get_form_field(), where is useful
is when the default behat_form_field class is being used, it
finds a input[type=radio] and it delegates set_value() and
get_value() to behat_form_radio.

get_value()   X-Ref
Returns the radio input value attribute.

Here we can not extend behat_form_checkbox because
isChecked() does internally a (bool)getValue() and
it is not good for radio buttons.

return: string The value attribute

set_value($value)   X-Ref
Sets the value of a radio

Partially overwriting behat_form_checkbox
implementation as when JS is disabled we
can not check() and we should use setValue()

param: string $value
return: void