Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
core\output\actions\component_action Class Reference
Inheritance diagram for core\output\actions\component_action:
core\output\templatable core\output\actions\confirm_action core\output\actions\popup_action

Public Member Functions

 __construct ($event, $jsfunction, $jsfunctionargs=[])
 Constructor.
 
 export_for_template (renderer_base $output)
 Export for template.
 

Public Attributes

string $event
 $event The DOM event that will trigger this action when caught
 
string $jsfunction = false
 A function name to call when the button is clicked The JS function you create must have two arguments:
 
array $jsfunctionargs = []
 An array of arguments to pass to the JS function.
 

Constructor & Destructor Documentation

◆ __construct()

core\output\actions\component_action::__construct ( $event,
$jsfunction,
$jsfunctionargs = [] )

Constructor.

Parameters
string$eventDOM event
string$jsfunctionAn optional JS function. Required if jsfunctionargs is given
array$jsfunctionargsAn array of arguments to pass to the jsfunction

Member Function Documentation

◆ export_for_template()

core\output\actions\component_action::export_for_template ( renderer_base $output)

Export for template.

Parameters
renderer_base$outputThe renderer.
Return values
stdClass

Implements core\output\templatable.

Member Data Documentation

◆ $jsfunction

string core\output\actions\component_action::$jsfunction = false

A function name to call when the button is clicked The JS function you create must have two arguments:

  1. The event object
  2. An object/array of arguments ($jsfunctionargs)

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