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}
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$formatters array Array of concrete formatters used by this class.
$localizationService Service
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$reflectionService Neos\Flow\Reflection\ReflectionService

공개 메소드들

메소드 설명
injectLocalizationService ( Service $localizationService ) : void
injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void
resolvePlaceholders ( string $textWithPlaceholders, array $arguments, Locale $locale = null ) : string Replaces all placeholders in text with corresponding values.

보호된 메소드들

메소드 설명
getFormatter ( string $formatterType ) : Neos\Flow\I18n\Formatter\FormatterInterface Returns instance of concrete formatter.

메소드 상세

getFormatter() 보호된 메소드

The type provided has to be either a name of existing class placed in I18n\Formatter namespace or a fully qualified class name; in both cases implementing this' package's FormatterInterface. For example, when $formatterName is 'number', the I18n\Formatter\NumberFormatter class has to exist; when $formatterName is 'Acme\Foobar\I18nFormatter\SampleFormatter', this class must exist and implement I18n\Formatter\FormatterInterface. Throws exception if there is no formatter for name given or one could be retrieved but does not satisfy the FormatterInterface.
protected getFormatter ( string $formatterType ) : Neos\Flow\I18n\Formatter\FormatterInterface
$formatterType string Either one of the built-in formatters or fully qualified formatter class name
리턴 Neos\Flow\I18n\Formatter\FormatterInterface The concrete formatter class

injectLocalizationService() 공개 메소드

public injectLocalizationService ( Service $localizationService ) : void
$localizationService Service
리턴 void

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

프로퍼티 상세

$formatters 보호되어 있는 프로퍼티

Array of concrete formatters used by this class.
protected array $formatters
리턴 array

$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