Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core\output\comboboxsearch Class Reference
Inheritance diagram for core\output\comboboxsearch:
renderable templatable

Public Member Functions

 __construct (bool $renderlater, string $buttoncontent, ?string $dropdowncontent=null, ?string $parentclasses=null, ?string $buttonclasses=null, ?string $dropdownclasses=null, ?string $buttonheader=null, ?bool $usebutton=true, ?string $label=null, ?string $name=null, ?string $value=null)
 The class constructor.
 
 export_for_template (renderer_base $output)
 Export the data for the mustache template.
 
 get_template ()
 Returns the standard template for the dropdown.
 

Protected Attributes

null string $buttonclasses
 $buttonclasses Any special classes to put on the HTMLElement that triggers the dropdown.
 
string $buttoncontent
 $buttoncontent What is the content of the "Button" that users will always see.
 
null string $buttonheader
 $buttonheader If the button item in the tertiary nav needs an extra top header for context.
 
null string $dropdownclasses
 $dropdownclasses Any special classes to put on the HTMLElement that contains the actual dropdown.
 
null string $dropdowncontent
 $dropdowncontent The content that can be passed in to render immediately.
 
null string $label
 $label The label of the combobox.
 
null string $name
 $name The name of the input element representing the combobox.
 
null string $parentclasses
 $parentclasses Any special classes to put on the HTMLElement that contains the BS events.
 
bool $renderlater
 $renderlater Should the dropdown render straightaway? We sometimes need to output the component without all of the data and leave the rendering of any defaults and actual data to the caller.
 
boolean $usesbutton
 $usesbutton Whether to provide a A11y button.
 
null string $value
 $value The value of the input element representing the combobox.
 

Constructor & Destructor Documentation

◆ __construct()

core\output\comboboxsearch::__construct ( bool $renderlater,
string $buttoncontent,
?string $dropdowncontent = null,
?string $parentclasses = null,
?string $buttonclasses = null,
?string $dropdownclasses = null,
?string $buttonheader = null,
?bool $usebutton = true,
?string $label = null,
?string $name = null,
?string $value = null )

The class constructor.

Parameters
bool$renderlaterHow we figure out if we should render the template instantly.
string$buttoncontentWhat gets placed in the button.
?string$dropdowncontentWhat will be placed in the dropdown if we are rendering now.
?string$parentclassesThe classes that can be added that the bootstrap events are attached to.
?string$buttonclassesAny special classes that may be needed.
?string$dropdownclassesAny special classes that may be needed.
?string$buttonheaderSometimes we want extra context for a button before it is shown, basically a pseudo header.
?bool$usebuttonIf we want the mustache to add the button roles for us or do we have another aria role node?
?string$labelThe label of the combobox.
?string$nameThe name of the input element representing the combobox.
?string$valueThe value of the input element representing the combobox.
Exceptions
moodle_exceptionIf the implementor incorrectly calls this module.

Member Function Documentation

◆ export_for_template()

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

Export the data for the mustache template.

Parameters
renderer_base$outputrenderer to be used to render the action bar elements.
Return values
array

Implements templatable.

◆ get_template()

core\output\comboboxsearch::get_template ( )

Returns the standard template for the dropdown.

Return values
string

Member Data Documentation

◆ $renderlater

bool core\output\comboboxsearch::$renderlater
protected

$renderlater Should the dropdown render straightaway? We sometimes need to output the component without all of the data and leave the rendering of any defaults and actual data to the caller.

We will give you a basic placeholder that can then be easily replaced.


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