Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\View\SnakHtmlGenerator Class Reference

Base class for generating Snak html. More...

Public Member Functions

 __construct (TemplateFactory $templateFactory, SnakFormatter $snakFormatter, EntityIdFormatter $propertyIdFormatter, LocalizedTextProvider $textProvider)
 
 getSnakHtml (Snak $snak, $showPropertyLink=false)
 Generates the HTML for a single snak.
 

Private Member Functions

 makePropertyLink (Snak $snak)
 
 getSnakViewVariation (Snak $snak)
 
 getFormattedSnakValue (Snak $snak)
 @fixme handle errors more consistently as done in JS UI, and perhaps add localised exception messages.
 
 getInvalidSnakMessage ()
 
 getPropertyNotFoundMessage ()
 

Private Attributes

 $templateFactory
 
 $snakFormatter
 
 $propertyIdFormatter
 
 $textProvider
 

Detailed Description

Base class for generating Snak html.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\View\SnakHtmlGenerator::__construct ( TemplateFactory  $templateFactory,
SnakFormatter  $snakFormatter,
EntityIdFormatter  $propertyIdFormatter,
LocalizedTextProvider  $textProvider 
)
Parameters
TemplateFactory$templateFactory
SnakFormatter$snakFormatter
EntityIdFormatter$propertyIdFormatter
LocalizedTextProvider$textProvider
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getFormattedSnakValue()

Wikibase\View\SnakHtmlGenerator::getFormattedSnakValue ( Snak  $snak)
private

@fixme handle errors more consistently as done in JS UI, and perhaps add localised exception messages.

Parameters
Snak$snak
Returns
string HTML

◆ getInvalidSnakMessage()

Wikibase\View\SnakHtmlGenerator::getInvalidSnakMessage ( )
private
Returns
string HTML

◆ getPropertyNotFoundMessage()

Wikibase\View\SnakHtmlGenerator::getPropertyNotFoundMessage ( )
private
Returns
string HTML

◆ getSnakHtml()

Wikibase\View\SnakHtmlGenerator::getSnakHtml ( Snak  $snak,
  $showPropertyLink = false 
)

Generates the HTML for a single snak.

Parameters
Snak$snak
bool$showPropertyLink
Returns
string

◆ getSnakViewVariation()

Wikibase\View\SnakHtmlGenerator::getSnakViewVariation ( Snak  $snak)
private
Parameters
Snak$snak
Returns
string

◆ makePropertyLink()

Wikibase\View\SnakHtmlGenerator::makePropertyLink ( Snak  $snak)
private
Parameters
Snak$snak
Returns
string

Member Data Documentation

◆ $propertyIdFormatter

Wikibase\View\SnakHtmlGenerator::$propertyIdFormatter
private

◆ $snakFormatter

Wikibase\View\SnakHtmlGenerator::$snakFormatter
private

◆ $templateFactory

Wikibase\View\SnakHtmlGenerator::$templateFactory
private

◆ $textProvider

Wikibase\View\SnakHtmlGenerator::$textProvider
private

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