Wikibase
MediaWiki Wikibase extension
Wikibase\View\Template\Template Class Reference

Allows storing and accessing of templates (e.g. More...

+ Inheritance diagram for Wikibase\View\Template\Template:
+ Collaboration diagram for Wikibase\View\Template\Template:

Public Member Functions

 __construct (TemplateRegistry $templateRegistry, $key, array $params=[])
 important! note that the Template class does not escape anything. More...
 
 render ()
 

Protected Member Functions

 fetchMessage ()
 Fetch a template from the template store. More...
 

Protected Attributes

 $templateRegistry
 

Detailed Description

Allows storing and accessing of templates (e.g.

snippets commonly used in server-side HTML generation and client-side JavaScript processing).

This class Represents a template that can contain placeholders just like MediaWiki messages.

Author
H. Snater media.nosp@m.wiki.nosp@m.@snat.nosp@m.er.c.nosp@m.om

Constructor & Destructor Documentation

◆ __construct()

Wikibase\View\Template\Template::__construct ( TemplateRegistry  $templateRegistry,
  $key,
array  $params = [] 
)

important! note that the Template class does not escape anything.

be sure to escape your params before using this class!

Parameters
TemplateRegistry$templateRegistry
string | string[]$keymessage key, or array of message keys to try and use the first non-empty message for
array$paramsArray message parameters

Member Function Documentation

◆ fetchMessage()

Wikibase\View\Template\Template::fetchMessage ( )
protected

Fetch a template from the template store.

See also
Message.fetchMessage
Returns
string template

◆ render()

Wikibase\View\Template\Template::render ( )

Member Data Documentation

◆ $templateRegistry

Wikibase\View\Template\Template::$templateRegistry
protected

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