Class SprintfFormatter
A formatter that will interpolate variables using sprintf and select the correct plural form when required
- Cake\I18n\Formatter\SprintfFormatter implements Aura\Intl\FormatterInterface
Method Detail
formatsource public
format( string $locale , string|array $message , array $vars )
Returns a string with all passed variables interpolated into the original message. Variables are interpolated using the sprintf format.
If an array is passed in $message, it will trigger the plural selection routine. Plural forms are selected depending on the locale and the _count key passed in $vars.
Parameters
- string
$locale - The locale in which the message is presented.
- string|array
$message - The message to be translated
- array
$vars - The list of values to interpolate in the message
Returns
stringThe formatted message
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.I18n.Formatter.SprintfFormatter.html