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

Public Member Functions

 __construct (TemplateRegistry $templateRegistry)
 
 getTemplates ()
 
 get ( $key, array $params)
 
 render ( $key,... $params)
 Shorthand function to retrieve a template filled with the specified parameters. More...
 

Static Public Member Functions

static getDefaultInstance ()
 

Private Attributes

 $templateRegistry
 

Static Private Attributes

static $instance
 

Detailed Description

Author
Adrian Heine adria.nosp@m.n.he.nosp@m.ine@w.nosp@m.ikim.nosp@m.edia..nosp@m.de
Thiemo Kreuz

Constructor & Destructor Documentation

◆ __construct()

Wikibase\View\Template\TemplateFactory::__construct ( TemplateRegistry  $templateRegistry)

Member Function Documentation

◆ get()

Wikibase\View\Template\TemplateFactory::get (   $key,
array  $params 
)
Parameters
string$key
array$params
Returns
Template

◆ getDefaultInstance()

static Wikibase\View\Template\TemplateFactory::getDefaultInstance ( )
static

◆ getTemplates()

Wikibase\View\Template\TemplateFactory::getTemplates ( )
Returns
string[] Array containing all raw template strings.

◆ render()

Wikibase\View\Template\TemplateFactory::render (   $key,
  $params 
)

Shorthand function to retrieve a template filled with the specified parameters.

important! note that the Template class does not escape anything. be sure to escape your params before using this function!

Parameters
string$keytemplate key Varargs: normal template parameters
string|array...$params
Returns
string

Member Data Documentation

◆ $instance

Wikibase\View\Template\TemplateFactory::$instance
staticprivate

◆ $templateRegistry

Wikibase\View\Template\TemplateFactory::$templateRegistry
private

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