Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Attributes | List of all members
core\output\checkbox_toggleall Class Reference

The checkbox-toggleall renderable class. More...

Inheritance diagram for core\output\checkbox_toggleall:
renderable templatable

Public Member Functions

 __construct (string $togglegroup, bool $ismaster, $options=[], $isbutton=false)
 Constructor. More...
 
 export_for_template (renderer_base $output)
 Export for template. More...
 
 get_template ()
 Fetches the appropriate template for the checkbox toggle all element. More...
 

Protected Attributes

bool $isbutton
 $isbutton Whether to render this as a button. More...
 
bool $ismaster
 $ismaster Whether we're rendering for a master checkbox or a slave checkbox.
 
array $options
 $options The options for the checkbox.
 
string $togglegroup
 The name of the group of checkboxes to be toggled.
 

Detailed Description

The checkbox-toggleall renderable class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core\output\checkbox_toggleall::__construct ( string  $togglegroup,
bool  $ismaster,
  $options = [],
  $isbutton = false 
)

Constructor.

Parameters
string$togglegroupThe name of the group of checkboxes to be toggled.
bool$ismasterWhether we're rendering for a master checkbox or a slave checkbox.
array$optionsThe options for the checkbox. Valid options are:
  • id string - The element ID.
  • name string - The element name.
  • classes string - CSS classes that you want to add for your checkbox or toggle controls. For button type master toggle controls, this could be any Bootstrap 4 btn classes that you might want to add. Defaults to "btn-secondary".
  • value string|int - The element's value.
  • checked boolean - Whether to render this initially as checked.
  • label string - The label for the checkbox element.
  • labelclasses string - CSS classes that you want to add for your label.
  • selectall string - Master only. The language string that will be used to indicate that clicking on the master will select all of the slave checkboxes. Defaults to "Select all".
  • deselectall string - Master only. The language string that will be used to indicate that clicking on the master will select all of the slave checkboxes. Defaults to "Deselect all".
bool$isbuttonWhether to render this as a button. Applies to master only.

Member Function Documentation

◆ export_for_template()

core\output\checkbox_toggleall::export_for_template ( renderer_base  $output)

Export for template.

Parameters
renderer_base$outputThe renderer.
Return values
stdClass

Implements templatable.

◆ get_template()

core\output\checkbox_toggleall::get_template ( )

Fetches the appropriate template for the checkbox toggle all element.

Return values
string

Member Data Documentation

◆ $isbutton

bool core\output\checkbox_toggleall::$isbutton
protected

$isbutton Whether to render this as a button.

Applies to master checkboxes only.


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