Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Attributes | List of all members
MoodleQuickForm_submit Class Reference
Inheritance diagram for MoodleQuickForm_submit:
templatable MoodleQuickForm_cancel

Public Member Functions

 __construct ($elementName=null, $value=null, $attributes=null, $primary=null, $options=[])
 constructor More...
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template. More...
 
 freeze ()
 Freeze the element so that only its value is returned.
 
 getElementTemplateType ()
 Slightly different container template when frozen. More...
 
 MoodleQuickForm_submit ($elementName=null, $value=null, $attributes=null, $primary=null)
 Old syntax of class constructor. More...
 
 onQuickFormEvent ($event, $arg, &$caller)
 Called by HTML_QuickForm whenever form event is made on this element. More...
 

Protected Attributes

string $customclassoverride
 Any class apart from 'btn' would be overridden with this content. More...
 
bool $primary
 $primary Is this button a primary button?
 

Constructor & Destructor Documentation

◆ __construct()

MoodleQuickForm_submit::__construct (   $elementName = null,
  $value = null,
  $attributes = null,
  $primary = null,
  $options = [] 
)

constructor

Parameters
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$primaryIs this button a primary button?
array$optionsOptions 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.

Member Function Documentation

◆ export_for_template()

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:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implements templatable.

◆ getElementTemplateType()

MoodleQuickForm_submit::getElementTemplateType ( )

Slightly different container template when frozen.

Don't want to display a submit button if the form is frozen.

Return values
string

◆ MoodleQuickForm_submit()

MoodleQuickForm_submit::MoodleQuickForm_submit (   $elementName = null,
  $value = null,
  $attributes = null,
  $primary = null 
)

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ onQuickFormEvent()

MoodleQuickForm_submit::onQuickFormEvent (   $event,
  $arg,
$caller 
)

Called by HTML_QuickForm whenever form event is made on this element.

Parameters
string$eventName of event
mixed$argevent arguments
object$callercalling object

Reimplemented in MoodleQuickForm_cancel.

Member Data Documentation

◆ $customclassoverride

string MoodleQuickForm_submit::$customclassoverride
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


The documentation for this class was generated from the following file: