Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Formatters\WikitextExternalIdentifierFormatter Class Reference

A formatter for PropertyValueSnaks that contain a StringValue that is interpreted as an external identifier. More...

+ Inheritance diagram for Wikibase\Lib\Formatters\WikitextExternalIdentifierFormatter:
+ Collaboration diagram for Wikibase\Lib\Formatters\WikitextExternalIdentifierFormatter:

Public Member Functions

 __construct (SnakUrlExpander $urlExpander)
 
 getFormat ()
 
- Public Member Functions inherited from Wikibase\Lib\Formatters\SnakFormatter
 formatSnak (Snak $snak)
 

Private Member Functions

 escapeWikitextInUrl ( $url)
 

Private Attributes

 $urlExpander
 

Additional Inherited Members

- Public Attributes inherited from Wikibase\Lib\Formatters\SnakFormatter
const OPT_LANG = ValueFormatter::OPT_LANG
 Options key for controlling the output language.
 
const FORMAT_PLAIN = 'text/plain'
 Output format types.
 
const FORMAT_WIKI = 'text/x-wiki'
 
const FORMAT_HTML = 'text/html'
 
const FORMAT_HTML_DIFF = 'text/html; disposition=diff'
 
const FORMAT_HTML_VERBOSE = 'text/html; disposition=verbose'
 
const FORMAT_HTML_VERBOSE_PREVIEW = 'text/html; disposition=verbose-preview'
 
const OPT_ON_ERROR = 'on-error'
 Options key for controlling error handling.
 
const ON_ERROR_WARN = 'warn'
 Value for the OPT_ON_ERROR option indicating that recoverable errors should cause a warning to be show to the user.
 
const ON_ERROR_FAIL = 'fail'
 Value for the OPT_ON_ERROR option indicating that recoverable errors should cause the formatting to fail with an exception.
 

Detailed Description

A formatter for PropertyValueSnaks that contain a StringValue that is interpreted as an external identifier.

The identifier is rendered as an wikitext link to some resource about the wikitext. The link is created based on a URL pattern associated with the snak's property id via a SnakUrlExpander.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Formatters\WikitextExternalIdentifierFormatter::__construct ( SnakUrlExpander  $urlExpander)

Member Function Documentation

◆ escapeWikitextInUrl()

Wikibase\Lib\Formatters\WikitextExternalIdentifierFormatter::escapeWikitextInUrl (   $url)
private

◆ getFormat()

Wikibase\Lib\Formatters\WikitextExternalIdentifierFormatter::getFormat ( )
See also
SnakFormatter::getFormat
Returns
string SnakFormatter::FORMAT_WIKI

Implements Wikibase\Lib\Formatters\SnakFormatter.

Member Data Documentation

◆ $urlExpander

Wikibase\Lib\Formatters\WikitextExternalIdentifierFormatter::$urlExpander
private

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