Float type form element Contains HTML class for a float type element
Copyright: | 2019 Shamim Rezaie <shamim@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 193 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
MoodleQuickForm_float:: (8 methods):
__construct()
onQuickFormEvent()
validateSubmitValue()
setValue()
getValue()
exportValue()
_getPersistantData()
format_float()
Class: MoodleQuickForm_float - X-Ref
Float type form element.__construct($elementName = null, $elementLabel = null, $attributes = null) X-Ref |
MoodleQuickForm_float constructor. param: string $elementName (optional) name of the float field param: string $elementLabel (optional) float field label param: string $attributes (optional) Either a typical HTML attribute string or an associative array |
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: bool |
validateSubmitValue($value) X-Ref |
Checks that the submitted value is a valid float number. param: string $value The localised float number that is submitted. return: string|null Validation error message or null. |
setValue($value) X-Ref |
Sets the value of the form element. param: string $value Default value of the form element |
getValue() X-Ref |
Returns the value of the form element. return: false|float |
exportValue(&$submitValues, $assoc = false) X-Ref |
Returns a 'safe' element's value. param: array $submitValues array of submitted values to search param: bool $assoc whether to return the value as associative array return: mixed |
_getPersistantData() X-Ref |
Used by getFrozenHtml() to pass the element's value if _persistantFreeze is on. return: string |
format_float($value) X-Ref |
Given a float, prints it nicely. This function reserves the number of decimal places. param: float|null $value The float number to format return: string Localised float |