PHP Класс Neos\Flow\I18n\FormatResolver
Placeholders have following syntax:
{id[,name[,attribute1[,attribute2...]]]}
Where 'id' is an index of argument to insert in place of placeholder, an
optional 'name' is a name of formatter to use for formatting the argument
(if no name given, provided argument will be just string-casted), and
optional attributes are strings directly passed to the formatter (what they
do depends on concrete formatter which is being used).
Examples:
{0}
{0,number,decimal}
{1,datetime,time,full}
Показать файл
Открыть проект
Примеры использования класса
Защищенные свойства (Protected)
Открытые методы
Защищенные методы
Метод |
Описание |
|
getFormatter ( string $formatterType ) : Neos\Flow\I18n\Formatter\FormatterInterface |
Returns instance of concrete formatter. |
|
Описание методов
injectLocalizationService()
публичный Метод
injectObjectManager()
публичный Метод
public injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void |
$objectManager |
Neos\Flow\ObjectManagement\ObjectManagerInterface |
|
Результат |
void |
|
resolvePlaceholders()
публичный Метод
A placeholder is a group of elements separated with comma. First element
is required and defines index of value to insert (numeration starts from
0, and is directly used to access element from $values array). Second
element is a name of formatter to use. It's optional, and if not given,
value will be simply string-casted. Remaining elements are formatter-
specific and they are directly passed to the formatter class.
public resolvePlaceholders ( string $textWithPlaceholders, array $arguments, Locale $locale = null ) : string |
$textWithPlaceholders |
string |
String message with placeholder(s) |
$arguments |
array |
An array of values to replace placeholders with |
$locale |
Locale |
Locale to use (NULL for default one) |
Результат |
string |
The $text with placeholders resolved |
Описание свойств
$localizationService защищенное свойство
protected Service,Neos\Flow\I18n $localizationService |
Результат |
Service |
|
$objectManager защищенное свойство
protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager |
Результат |
Neos\Flow\ObjectManagement\ObjectManagerInterface |
|
$reflectionService защищенное свойство
protected ReflectionService,Neos\Flow\Reflection $reflectionService |
Результат |
Neos\Flow\Reflection\ReflectionService |
|