Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct (Language $language) | |
addFromKey ( $key) | |
addFromArray (array $messages) | |
getMessages () | |
setType ( $type) | |
escape ( $escape) | |
clear () | |
exists () | |
setLanguage (Language $language) | |
getHtml () | |
getPlain () | |
Static Public Member Functions | |
static | newFromArray (Language $language, array $messages=[]) |
Protected Member Functions | |
doFormat (array $messages) | |
getString ( $html=true) | |
Protected Attributes | |
$messages = [] | |
$type = 'warning' | |
$separator = ' <!--br-->' | |
$escape = true | |
Class implementing message output formatting
GNU GPL v2+
SMW\MessageFormatter::__construct | ( | Language | $language | ) |
Language | $language |
SMW\MessageFormatter::addFromArray | ( | array | $messages | ) |
Adds an arbitrary array of messages which can either contain text or/and Message objects
array | $messages |
SMW\MessageFormatter::addFromKey | ( | $key | ) |
Creates a Message object from a key and adds it to an internal array
string | $key | message key |
SMW\MessageFormatter::clear | ( | ) |
|
protected |
Formatting and normalization of an array
array | $messages |
SMW\MessageFormatter::escape | ( | $escape | ) |
Enables/disables escaping for the output representation
boolean | $escape |
SMW\MessageFormatter::exists | ( | ) |
Returns if the internal message array does contain messages
SMW\MessageFormatter::getHtml | ( | ) |
Returns html representation of the formatted messages
SMW\MessageFormatter::getMessages | ( | ) |
Returns unformatted invoked messages
SMW\MessageFormatter::getPlain | ( | ) |
Returns plain text representation of the formatted messages
|
protected |
Converts the message array into a string representation
boolean | $escape | |
boolean | $html |
|
static |
Convenience factory method to invoke a message array together with a language object
Language | $language | |
array | null | $messages |
SMW\MessageFormatter::setLanguage | ( | Language | $language | ) |
SMW\MessageFormatter::setType | ( | $type | ) |
Used in connection with the html output to invoke a specific display type