Wikibase
MediaWiki Wikibase extension
Wikibase\View\StatementHtmlGenerator Class Reference

Backend renderer that generates the HTML representation of a statement for use in an entity view. More...

Public Member Functions

 __construct (TemplateFactory $templateFactory, SnakHtmlGenerator $snakHtmlGenerator, NumberLocalizer $numberLocalizer, LocalizedTextProvider $textProvider)
 
 getHtmlForStatement (Statement $statement, $editSectionHtml)
 Builds and returns the HTML representing a single WikibaseEntity's statement. More...
 

Private Member Functions

 getHtmlForQualifiers (SnakList $qualifiers)
 
 getHtmlForReferences (ReferenceList $referenceList)
 
 wrapInListview ( $listviewContent)
 
 getHtmlForReference (Reference $reference)
 
 getSnaklistviewHtml (array $snaks)
 
 getReferencesHeading (Statement $statement)
 
 getRankSelector ( $rank)
 

Private Attributes

const RANK_NAMES
 
 $templateFactory
 
 $snakHtmlGenerator
 
 $numberLocalizer
 
 $referenceHeadings = []
 
 $statementRankSelector = []
 
 $textProvider
 

Detailed Description

Backend renderer that generates the HTML representation of a statement for use in an entity view.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\View\StatementHtmlGenerator::__construct ( TemplateFactory  $templateFactory,
SnakHtmlGenerator  $snakHtmlGenerator,
NumberLocalizer  $numberLocalizer,
LocalizedTextProvider  $textProvider 
)

Member Function Documentation

◆ getHtmlForQualifiers()

Wikibase\View\StatementHtmlGenerator::getHtmlForQualifiers ( SnakList  $qualifiers)
private
Parameters
SnakList$qualifiers
Returns
string HTML PhanTypeMismatchArgument

◆ getHtmlForReference()

Wikibase\View\StatementHtmlGenerator::getHtmlForReference ( Reference  $reference)
private
Parameters
Reference$reference
Returns
string HTML PhanTypeMismatchArgument

◆ getHtmlForReferences()

Wikibase\View\StatementHtmlGenerator::getHtmlForReferences ( ReferenceList  $referenceList)
private
Parameters
ReferenceList$referenceList
Returns
string HTML

◆ getHtmlForStatement()

Wikibase\View\StatementHtmlGenerator::getHtmlForStatement ( Statement  $statement,
  $editSectionHtml 
)

Builds and returns the HTML representing a single WikibaseEntity's statement.

Parameters
Statement$statement
string$editSectionHtmlhas the html for the edit section
Returns
string HTML

◆ getRankSelector()

Wikibase\View\StatementHtmlGenerator::getRankSelector (   $rank)
private
Parameters
int$rank
Returns
string HTML

◆ getReferencesHeading()

Wikibase\View\StatementHtmlGenerator::getReferencesHeading ( Statement  $statement)
private
Parameters
Statement$statement
Returns
string HTML

◆ getSnaklistviewHtml()

Wikibase\View\StatementHtmlGenerator::getSnaklistviewHtml ( array  $snaks)
private
Parameters
Snak[]$snaks
Returns
string HTML

◆ wrapInListview()

Wikibase\View\StatementHtmlGenerator::wrapInListview (   $listviewContent)
private

Member Data Documentation

◆ $numberLocalizer

Wikibase\View\StatementHtmlGenerator::$numberLocalizer
private

◆ $referenceHeadings

Wikibase\View\StatementHtmlGenerator::$referenceHeadings = []
private

◆ $snakHtmlGenerator

Wikibase\View\StatementHtmlGenerator::$snakHtmlGenerator
private

◆ $statementRankSelector

Wikibase\View\StatementHtmlGenerator::$statementRankSelector = []
private

◆ $templateFactory

Wikibase\View\StatementHtmlGenerator::$templateFactory
private

◆ $textProvider

Wikibase\View\StatementHtmlGenerator::$textProvider
private

◆ RANK_NAMES

const Wikibase\View\StatementHtmlGenerator::RANK_NAMES
private
Initial value:
= [
Statement::RANK_DEPRECATED => 'deprecated',
Statement::RANK_NORMAL => 'normal',
Statement::RANK_PREFERRED => 'preferred'
]

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