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

EscapingValueFormatter wraps another ValueFormatter and applies a transformation (escaping) to that formatter's output. More...

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

Public Member Functions

 __construct (ValueFormatter $formatter, $escapeCallback)
 
 format ( $value)
 

Private Attributes

 $formatter
 
 $escapeCallback
 

Detailed Description

EscapingValueFormatter wraps another ValueFormatter and applies a transformation (escaping) to that formatter's output.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Formatters\EscapingValueFormatter::__construct ( ValueFormatter $formatter,
$escapeCallback )
Parameters
ValueFormatter$formatterA formatter returning plain text.
callable$escapeCallbackA callable taking plain text and returning escaped text.
Exceptions
InvalidArgumentException

Member Function Documentation

◆ format()

Wikibase\Lib\Formatters\EscapingValueFormatter::format ( $value)
See also
ValueFormatter::format
Parameters
mixed$value
Returns
string Typically wikitext or HTML, depending on the $escapeCallback provided.

Member Data Documentation

◆ $escapeCallback

Wikibase\Lib\Formatters\EscapingValueFormatter::$escapeCallback
private

◆ $formatter

Wikibase\Lib\Formatters\EscapingValueFormatter::$formatter
private

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