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

Class to preapare a list of tags for display, usually the list of tags some entry is tagged with. More...

Inheritance diagram for core_tag\output\taglist:
templatable

Public Member Functions

 __construct ($tags, $label=null, $classes='', $limit=10, $pagecontext=null, $accesshidelabel=false)
 Constructor. More...
 
 export_for_template (renderer_base $output)
 Export this data so it can be used as the context for a mustache template. More...
 

Protected Attributes

bool $accesshidelabel
 $accesshidelabel if true, the label should have class="accesshide" added.
 
string $classes
 
string $label
 
int $limit
 
array $tags
 

Detailed Description

Class to preapare a list of tags for display, usually the list of tags some entry is tagged with.

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

Constructor & Destructor Documentation

◆ __construct()

core_tag\output\taglist::__construct (   $tags,
  $label = null,
  $classes = '',
  $limit = 10,
  $pagecontext = null,
  $accesshidelabel = false 
)

Constructor.

Parameters
array$tagslist of instances of core_tag_tag or stdClass
string$labellabel to display in front, by default 'Tags' (get_string('tags')), set to null to use default, set to '' (empty string) to omit the label completely
string$classesadditional classes for the enclosing div element
int$limitlimit the number of tags to display, if size of $tags is more than this limit the "more" link will be appended to the end, JS will toggle the rest of the tags. 0 means no limit.
context$pagecontextspecify if needed to overwrite the current page context for the view tag link
bool$accesshidelabelif true, the label should have class="accesshide" added.

Member Function Documentation

◆ export_for_template()

core_tag\output\taglist::export_for_template ( renderer_base  $output)

Export this data so it can be used as the context for a mustache template.

Parameters
renderer_base$output
Return values
stdClass

Implements templatable.


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