MediaWiki master
MediaWiki\EditPage\TemplatesOnThisPageFormatter Class Reference

Handles formatting for the "templates used on this page" lists. More...

Public Member Functions

 __construct (private readonly IContextSource $context, private readonly LinkRenderer $linkRenderer, private readonly LinkBatchFactory $linkBatchFactory, private readonly RestrictionStore $restrictionStore)
 format (array $templates, $type=false, $more=null)
 Make an HTML list of templates, and then add a "More..." link at the bottom.

Detailed Description

Handles formatting for the "templates used on this page" lists.

Formerly known as Linker::formatTemplates()

Since
1.28

Definition at line 26 of file TemplatesOnThisPageFormatter.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\EditPage\TemplatesOnThisPageFormatter::__construct ( private readonly IContextSource $context,
private readonly LinkRenderer $linkRenderer,
private readonly LinkBatchFactory $linkBatchFactory,
private readonly RestrictionStore $restrictionStore )

Definition at line 28 of file TemplatesOnThisPageFormatter.php.

Member Function Documentation

◆ format()

MediaWiki\EditPage\TemplatesOnThisPageFormatter::format ( array $templates,
$type = false,
$more = null )

Make an HTML list of templates, and then add a "More..." link at the bottom.

If $more is null, do not add a "More..." link. If $more is a PageReference, make a link to that page and use it. If $more is a string, directly paste it in as the link (escaping needs to be done manually).

Parameters
PageIdentity[]$templates
string | false$type'preview' if a preview, 'section' if a section edit, false if neither
PageReference | string | null$moreAn escaped link for "More..." of the templates
Returns
string HTML output

Definition at line 47 of file TemplatesOnThisPageFormatter.php.

References if.


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