i18n\Formatter createNumberFormatter()

createNumberFormatter() protected method Creates a number formatter based on the given type and format. You may override this method to create a number formatter based on patterns. protected \NumberFormatter createNumberFormatter ( $style, $decimals = null, $options = [], $textOptions = [] )$style integer The type of the number formatter. Values: NumberFormatter::DECIMAL, ::CURRENCY, ::PERCENT, ::SCIENTIFIC, ::SPELLOUT, ::ORDINAL ::DURATION, ::PATTERN_RULEBASED, ::DEFAULT_STYLE, ::IGNORE

i18n\Formatter asUrl()

asUrl() public method Formats the value as a hyperlink. public string asUrl ( $value, $options = [] )$value mixed The value to be formatted. $options array The tag options in terms of name-value pairs. See yii\helpers\Html::a(). return string The formatted result.

i18n\Formatter asTimestamp()

asTimestamp() public method Formats a date, time or datetime in a float number as UNIX timestamp (seconds since 01-01-1970). public string asTimestamp ( $value )$value integer|string|DateTime The value to be formatted. The following types of value are supported: an integer representing a UNIX timestamp a string that can be parsed to create a DateTime object. The timestamp is assumed to be in $defaultTimeZone unless a time zone is explicitly given. a PHP DateTime object return string

i18n\Formatter asTime()

asTime() public method Formats the value as a time. See also $timeFormat. public string asTime ( $value, $format = null )$value integer|string|DateTime The value to be formatted. The following types of value are supported: an integer representing a UNIX timestamp a string that can be parsed to create a DateTime object. The timestamp is assumed to be in $defaultTimeZone unless a time zone is explicitly given. a PHP DateTime object $format string The format used to convert the value in

i18n\Formatter asText()

asText() public method Formats the value as an HTML-encoded plain text. public string asText ( $value )$value string The value to be formatted. return string The formatted result.

i18n\Formatter asSpellout()

asSpellout() public method Formats the value as a number spellout. This function requires the PHP intl extension to be installed. public string asSpellout ( $value )$value mixed The value to be formatted return string The formatted result. throws yii\base\InvalidParamException if the input value is not numeric or the formatting failed. throws yii\base\InvalidConfigException when the PHP intl extension is not available.

i18n\Formatter asSize()

asSize() public method Formats the value in bytes as a size in human readable form, for example 12 kilobytes. If $sizeFormatBase is 1024, binary prefixes (e.g. kibibyte/KiB, mebibyte/MiB, ...) are used in the formatting result. See also: \yii\i18n\sizeFormat asShortSize() public string asSize ( $value, $decimals = null, $options = [], $textOptions = [] )$value string|integer|float Value in bytes to be formatted. $decimals integer The number of digits after the decimal point. $option

i18n\Formatter asShortSize()

asShortSize() public method Formats the value in bytes as a size in human readable form for example 12 KB. This is the short form of asSize(). If $sizeFormatBase is 1024, binary prefixes (e.g. kibibyte/KiB, mebibyte/MiB, ...) are used in the formatting result. See also: \yii\i18n\sizeFormat asSize() public string asShortSize ( $value, $decimals = null, $options = [], $textOptions = [] )$value string|integer|float Value in bytes to be formatted. $decimals integer The number of digits

i18n\Formatter asScientific()

asScientific() public method Formats the value as a scientific number. public string asScientific ( $value, $decimals = null, $options = [], $textOptions = [] )$value mixed The value to be formatted. $decimals integer The number of digits after the decimal point. $options array Optional configuration for the number formatter. This parameter will be merged with $numberFormatterOptions. $textOptions array Optional configuration for the number formatter. This parameter will be merged

i18n\Formatter asRelativeTime()

asRelativeTime() public method Formats the value as the time interval between a date and now in human readable form. This method can be used in three different ways: Using a timestamp that is relative to now. Using a timestamp that is relative to the $referenceTime. Using a DateInterval object. public string asRelativeTime ( $value, $referenceTime = null )$value integer|string|DateTime|DateInterval The value to be formatted. The following types of value are supported: an integer repres