Wikibase
MediaWiki Wikibase extension
Wikibase\View\ViewContent Class Reference

A view containing rendered HTML that may still contain placeholders to be replaced before the HTML can be presented to the end-user. More...

Public Member Functions

 __construct ( $html, array $placeholders=[])
 
 getHtml ()
 
 getPlaceholders ()
 Get information about the placeholders contained in the HTML. More...
 

Private Attributes

 $html
 
 $placeholders
 

Detailed Description

A view containing rendered HTML that may still contain placeholders to be replaced before the HTML can be presented to the end-user.

The placeholders can e.g. be stored in the (cached) ParserOutput object for later use in the page output.

See also
\ParserOutput::setExtensionData()
\Wikibase\Repo\RepoHooks::onOutputPageParserOutput()

Constructor & Destructor Documentation

◆ __construct()

Wikibase\View\ViewContent::__construct (   $html,
array  $placeholders = [] 
)

Member Function Documentation

◆ getHtml()

Wikibase\View\ViewContent::getHtml ( )
Returns
string HTML

◆ getPlaceholders()

Wikibase\View\ViewContent::getPlaceholders ( )

Get information about the placeholders contained in the HTML.

Naming this is hard as it confusingly contains both meta data for single placeholders (e.g. wikibase-terms-list-item) as well as some placeholder record keeping (e.g. wikibase-view-chunks) which would better be depicted as a hierarchie than a group of peers

Returns
array

Member Data Documentation

◆ $html

Wikibase\View\ViewContent::$html
private

◆ $placeholders

Wikibase\View\ViewContent::$placeholders
private

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