Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
tool_componentlibrary\local\examples\dynamictabs\tab2 Class Reference

Example tab class. More...

Inheritance diagram for tool_componentlibrary\local\examples\dynamictabs\tab2:
core\output\dynamic_tabs\base core\output\templatable

Public Member Functions

 add_data (array $data)
 Add custom data to the tab data attributes.
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template.
 
 export_for_template (renderer_base $output)
 Export this for use in a mustache template context.
 
 get_data ()
 Return tab data attributes.
 
 get_tab_id ()
 HTML "id" attribute that should be used for this tab, by default the last part of class name.
 
 get_tab_label ()
 The label to be displayed on the tab.
 
 get_template ()
 Template to use to display tab contents.
 
 is_available ()
 Check permission of the current user to access this tab.
 
 require_access ()
 Check that tab is accessible, throw exception otherwise - used from WS requesting tab contents.
 

Protected Attributes

array $data
 

Detailed Description

Example tab class.

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

Member Function Documentation

◆ add_data()

core\output\dynamic_tabs\base::add_data ( array $data)
inherited

Add custom data to the tab data attributes.

Parameters
array$data

◆ export_for_template() [1/2]

core\output\templatable::export_for_template ( renderer_base $output)
inherited

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

Implemented in core\output\action_menu, core\output\actions\component_action, core\output\activity_header, core\output\checkbox_toggleall, core\output\choicelist, core\output\chooser, core\output\chooser_item, core\output\chooser_section, core\output\comboboxsearch, core\output\context_header, core\output\custom_menu_item, core\output\dynamic_tabs, core\output\help_icon, core\output\initials_bar, core\output\paging_bar, core\output\pix_icon, core\output\pix_icon_font, core\output\progress_bar, core\output\select_menu, core\output\single_select, core\output\tabobject, core\output\tabtree, core\output\url_select, core_course\output\actionbar\group_selector_button, core_course\output\actionbar\group_selector_dropdown_form, and core_course\output\actionbar\user_selector_button.

◆ export_for_template() [2/2]

tool_componentlibrary\local\examples\dynamictabs\tab2::export_for_template ( renderer_base $output)

Export this for use in a mustache template context.

Parameters
renderer_base$output
Return values
stdClass

◆ get_data()

core\output\dynamic_tabs\base::get_data ( )
inherited

Return tab data attributes.

Return values
array

◆ get_tab_id()

core\output\dynamic_tabs\base::get_tab_id ( )
inherited

HTML "id" attribute that should be used for this tab, by default the last part of class name.

Return values
string

◆ get_tab_label()

tool_componentlibrary\local\examples\dynamictabs\tab2::get_tab_label ( )

The label to be displayed on the tab.

Return values
string

Reimplemented from core\output\dynamic_tabs\base.

◆ get_template()

tool_componentlibrary\local\examples\dynamictabs\tab2::get_template ( )

Template to use to display tab contents.

Return values
string

Reimplemented from core\output\dynamic_tabs\base.

◆ is_available()

tool_componentlibrary\local\examples\dynamictabs\tab2::is_available ( )

Check permission of the current user to access this tab.

Return values
bool

Reimplemented from core\output\dynamic_tabs\base.

◆ require_access()

core\output\dynamic_tabs\base::require_access ( )
finalinherited

Check that tab is accessible, throw exception otherwise - used from WS requesting tab contents.

Exceptions
moodle_exception

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