Fr3nch13/CakePHP Utilities

SprintfFormatter
in package
implements FormatterInterface

A formatter that will interpolate variables using sprintf and select the correct plural form when required

Table of Contents

Interfaces

FormatterInterface
Formatter Interface

Methods

format()  : string
Returns a string with all passed variables interpolated into the original message. Variables are interpolated using the sprintf format.

Methods

format()

Returns a string with all passed variables interpolated into the original message. Variables are interpolated using the sprintf format.

public format(string $locale, string $message, array<string|int, mixed> $tokenValues) : string
Parameters
$locale : string

The locale in which the message is presented.

$message : string

The message to be translated

$tokenValues : array<string|int, mixed>

The list of values to interpolate in the message

Return values
string

The formatted message


        
On this page

Search results