__construct()
__toString()
getLanguageId()
getParams()
getPhraseName()
loadPhrases()
preloadPhrase()
render()
reset()
setEscapeCallback()
setInsertParamsEscaped()
setLanguageId()
setParams()
setPhrase()
setPhraseNameOnInvalid()
setPhrases()
_escapeParam()
_loadPhrase()
_replaceParam()
$_escapeCallback
$_insertParamsEscaped
$_languageId
$_params
$_phraseCache
$_phraseName
$_phraseNameOnInvalid
$_toLoad
Phrase rendering class.
package | XenForo_Core |
---|
__construct(string | array $phraseName, array $params, boolean | array $insertParamsEscaped)
string
array
Phrase name (or, array(phraseName, arg1 => x, arg2 => y...)
array
Key-value parameters
boolean
array
See {@link $_insertParamsEscaped}
__toString() : string
string
getLanguageId() : integer
integer
getParams() : array
array
getPhraseName() : string
string
loadPhrases()
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.
string
Phrase to preload
render(boolean | null $phraseNameOnInvalid) : string
boolean
null
If the phrase is invalid, return the phrase name (otherwise, empty string); if null, use default setting
string
reset()
setEscapeCallback(false | callback $callback)
false
callback
setInsertParamsEscaped($insertParamsEscaped)
see | \global\$_insertParamsEscaped |
---|
array|boolean
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.
string
Name of the phrase
string
Value 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
string
Name of parameter
string
Value of parameter
string
Escaped parameter_loadPhrase(string $phraseName) : string
string
Phrase name
string
Compiled version of the phrase_replaceParam(array $match) : string
array
Match array. Looks in key "param".
string
Replaced value$_escapeCallback
This should be set by the view renderer. Set it to false to disable escaping completely.
param | false|callback |
---|
$_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.