MediaWiki REL1_41
MediaWiki\EditPage\TemplatesOnThisPageFormatter Class Reference

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

Public Member Functions

 __construct (IContextSource $context, LinkRenderer $linkRenderer, LinkBatchFactory $linkBatchFactory, 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 38 of file TemplatesOnThisPageFormatter.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 66 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 89 of file TemplatesOnThisPageFormatter.php.


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