Documentation

getMessage

string public static
\Bitrix\Main\Localization\Loc::getMessage(
 string $code,
 array $replace = null,
 string $language = null
);

Static method returns message by ID on the current language. Arrays of corresponding codes and messages are specified in language files. Before using this function, connect a corresponding language file ( Loc::loadMessages(__FILE__)).

Similar to the old core: GetMessage

Parameters

ParameterDescriptionVersion
$codeMessage code. Code must be unique within the complete product.
$replaceArray of "template" => "replacement"pairs. It allows organising replacement by template. For example, array("#NUM#"=>5).
$languageLanguage ID.

Example



© «Bitrix24», 2001-2024
Up