0 follower

Interface Yiisoft\Translator\MessageFormatterInterface

Implemented byYiisoft\Translator\IntlMessageFormatter, Yiisoft\Translator\NullMessageFormatter, Yiisoft\Translator\SimpleMessageFormatter

Message formatter formats the message using parameters and taking locale into account.

Public Methods

Hide inherited methods

Method Description Defined By
format() Formats the message using parameters and taking locale into account. Yiisoft\Translator\MessageFormatterInterface

Method Details

Hide inherited methods

format() public abstract method

Formats the message using parameters and taking locale into account.

public abstract string format ( string $message, array $parameters, string $locale )
$message string

A message to format.

$parameters array

Parameters to replace in the message in ['name1' => 'value1', 'name2' => 'value2'] format.

$locale string

Locale to use when formatting. Usually affects formatting numbers, dates etc.

return string

Formatted message.

                public function format(string $message, array $parameters, string $locale): string;