Phrase rendering class.
| package | XenForo_Core |
|---|
__construct(string | array $phraseName, array $params, boolean | array $insertParamsEscaped)
stringarrayPhrase name (or, array(phraseName, arg1 => x, arg2 => y...)
arrayKey-value parameters
booleanarraySee {@link $_insertParamsEscaped}
__toString() : string
stringgetLanguageId() : integer
integergetParams() : array
arraygetPhraseName() : string
stringloadPhrases()
preloadPhrase(string $phraseName)
This is useful if you think a render is going to be called before the phrase you require is to be used.
stringPhrase to preload
render(boolean | null $phraseNameOnInvalid) : string
booleannullIf the phrase is invalid, return the phrase name (otherwise, empty string); if null, use default setting
stringreset()
setEscapeCallback(false | callback $callback)
falsecallback
setInsertParamsEscaped(array | boolean $insertParamsEscaped)
setLanguageId(integer $languageId)
integer
setParams(array $params)
Overwrites parameters with the same name.
array
setPhrase(string $phraseName, string $phraseValue)
This is primarily useful for testing.
stringName of the phrase
stringValue for the phrase
setPhraseNameOnInvalid(boolean $value)
This controls the behavior with an invalid phrase name. If true, output phrase name; otherwise, nothing.
boolean
setPhrases(array $phrases)
array
_escapeParam(string $paramName, string $paramValue) : string
stringName of parameter
stringValue of parameter
stringEscaped parameter_loadPhrase(string $phraseName) : string
stringPhrase name
stringCompiled version of the phrase_replaceParam(array $match) : string
arrayMatch array. Looks in key "param".
stringReplaced value$_escapeCallback
This should be set by the view renderer. Set it to false to disable escaping completely.
| param |
|---|
$_insertParamsEscaped : boolean | array
If this is true or false, it applies to all params. If it is an array, the individual params are looked up as keys and the value is treated as a a boolean; params that aren't set will be escaped.
$_languageId : integer
$_params : array
$_phraseCache : array
Key is the phrase name; value is the phrase text.
$_phraseName : string
$_phraseNameOnInvalid : boolean
$_toLoad : array
Key is the phrase name.