Float type form element.
More...
|
string | $_helpbutton ='' |
| html for help button, if empty then no help
|
|
bool | $_hiddenLabel =false |
| if true label will be hidden
|
|
|
bool | $forceltr = false |
| Whether to force the display of this element to flow LTR.
|
|
Float type form element.
This is preferred over the text element when working with float numbers, and takes care of the fact that different languages may use different symbols as the decimal separator. Using this element, submitted float numbers will be automatically translated from the localised format into the computer format, and vice versa when they are being displayed.
- Copyright
- 2019 Shamim Rezaie shami.nosp@m.m@mo.nosp@m.odle..nosp@m.com
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
MoodleQuickForm_float::__construct |
( |
| $elementName = null, |
|
|
| $elementLabel = null, |
|
|
| $attributes = null ) |
MoodleQuickForm_float constructor.
- Parameters
-
string | $elementName | (optional) name of the float field |
string | $elementLabel | (optional) float field label |
string | $attributes | (optional) Either a typical HTML attribute string or an associative array |
Reimplemented from MoodleQuickForm_text.
◆ _getPersistantData()
MoodleQuickForm_float::_getPersistantData |
( |
| ) |
|
Used by getFrozenHtml() to pass the element's value if _persistantFreeze is on.
- Return values
-
◆ exportValue()
MoodleQuickForm_float::exportValue |
( |
& | $submitValues, |
|
|
| $assoc = false ) |
Returns a 'safe' element's value.
- Parameters
-
array | $submitValues | array of submitted values to search |
bool | $assoc | whether to return the value as associative array |
- Return values
-
◆ freeze()
MoodleQuickForm_text::freeze |
( |
| ) |
|
|
inherited |
Freeze the element so that only its value is returned and set persistantfreeze to false.
- Since
- Moodle 2.4
- Return values
-
◆ get_force_ltr()
MoodleQuickForm_text::get_force_ltr |
( |
| ) |
|
|
inherited |
Get force LTR option.
- Return values
-
◆ getFrozenHtml()
MoodleQuickForm_text::getFrozenHtml |
( |
| ) |
|
|
inherited |
Returns the html to be used when the element is frozen.
- Since
- Moodle 2.4
- Return values
-
◆ getHelpButton()
MoodleQuickForm_text::getHelpButton |
( |
| ) |
|
|
inherited |
get html for help button
- Return values
-
string | html for help button |
◆ getValue()
MoodleQuickForm_float::getValue |
( |
| ) |
|
Returns the value of the form element.
- Return values
-
◆ MoodleQuickForm_text()
MoodleQuickForm_text::MoodleQuickForm_text |
( |
| $elementName = null, |
|
|
| $elementLabel = null, |
|
|
| $attributes = null ) |
|
inherited |
◆ onQuickFormEvent()
MoodleQuickForm_float::onQuickFormEvent |
( |
| $event, |
|
|
| $arg, |
|
|
& | $caller ) |
Called by HTML_QuickForm whenever form event is made on this element.
- Parameters
-
string | $event | Name of event |
mixed | $arg | event arguments |
object | $caller | calling object |
- Return values
-
◆ set_force_ltr()
MoodleQuickForm_text::set_force_ltr |
( |
| $value | ) |
|
|
inherited |
Force the field to flow left-to-right.
This is useful for fields such as URLs, passwords, settings, etc...
- Parameters
-
bool | $value | The value to set the option to. |
◆ setHiddenLabel()
MoodleQuickForm_text::setHiddenLabel |
( |
| $hiddenLabel | ) |
|
|
inherited |
Sets label to be hidden.
- Parameters
-
bool | $hiddenLabel | sets if label should be hidden |
◆ setValue()
MoodleQuickForm_float::setValue |
( |
| $value | ) |
|
Sets the value of the form element.
- Parameters
-
string | $value | Default value of the form element |
◆ toHtml()
MoodleQuickForm_text::toHtml |
( |
| ) |
|
|
inherited |
◆ validateSubmitValue()
MoodleQuickForm_float::validateSubmitValue |
( |
| $value | ) |
|
Checks that the submitted value is a valid float number.
- Parameters
-
string | $value | The localised float number that is submitted. |
- Return values
-
string|null | Validation error message or null. |
The documentation for this class was generated from the following file: