Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
submit type form element More...
Public Member Functions | |
__construct ($elementName=null, $value=null, $attributes=null, $primary=null, $options=[]) | |
constructor | |
export_for_template (renderer_base $output) | |
Function to export the renderer data in a format that is suitable for a mustache template. | |
freeze () | |
Freeze the element so that only its value is returned. | |
getElementTemplateType () | |
Slightly different container template when frozen. | |
MoodleQuickForm_submit ($elementName=null, $value=null, $attributes=null, $primary=null) | |
Old syntax of class constructor. | |
onQuickFormEvent ($event, $arg, &$caller) | |
Called by HTML_QuickForm whenever form event is made on this element. | |
Protected Attributes | |
string | $customclassoverride |
Any class apart from 'btn' would be overridden with this content. | |
bool | $primary |
$primary Is this button a primary button? | |
submit type form element
HTML class for a submit type element
MoodleQuickForm_submit::__construct | ( | $elementName = null, | |
$value = null, | |||
$attributes = null, | |||
$primary = null, | |||
$options = [] ) |
constructor
string | $elementName | (optional) name of the field |
string | $value | (optional) field label |
string | $attributes | (optional) Either a typical HTML attribute string or an associative array |
bool | null | $primary | Is this button a primary button? |
array | $options | Options to further customise the submit button. Currently accepted options are: customclassoverride String The CSS class to use for the button instead of the standard btn-primary and btn-secondary classes. |
MoodleQuickForm_submit::export_for_template | ( | renderer_base | $output | ) |
Function to export the renderer data in a format that is suitable for a mustache template.
This means:
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
stdClass|array |
Implements templatable.
MoodleQuickForm_submit::getElementTemplateType | ( | ) |
Slightly different container template when frozen.
Don't want to display a submit button if the form is frozen.
string |
MoodleQuickForm_submit::MoodleQuickForm_submit | ( | $elementName = null, | |
$value = null, | |||
$attributes = null, | |||
$primary = null ) |
MoodleQuickForm_submit::onQuickFormEvent | ( | $event, | |
$arg, | |||
& | $caller ) |
Called by HTML_QuickForm whenever form event is made on this element.
string | $event | Name of event |
mixed | $arg | event arguments |
object | $caller | calling object |
Reimplemented in MoodleQuickForm_cancel.
|
protected |
Any class apart from 'btn' would be overridden with this content.
By default, submit buttons will utilize the btn-primary OR btn-secondary classes. However there are cases where we require a submit button with different stylings (e.g. btn-link). In these cases, $customclassoverride will override the defaults mentioned previously and utilize the provided class(es).
$customclassoverride Custom class override for the input element