i18n\Formatter asRaw()

asRaw() public method Formats the value as is without any formatting. This method simply returns back the parameter without any format. The only exception is a null value which will be formatted using $nullDisplay. public string asRaw ( $value )$value mixed The value to be formatted. return string The formatted result.

i18n\Formatter asPercent()

asPercent() public method Formats the value as a percent number with "%" sign. public string asPercent ( $value, $decimals = null, $options = [], $textOptions = [] )$value mixed The value to be formatted. It must be a factor e.g. 0.75 will result in 75%. $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 f

i18n\Formatter asParagraphs()

asParagraphs() public method Formats the value as HTML-encoded text paragraphs. Each text paragraph is enclosed within a <p> tag. One or multiple consecutive empty lines divide two paragraphs. public string asParagraphs ( $value )$value string The value to be formatted. return string The formatted result.

i18n\Formatter asOrdinal()

asOrdinal() public method Formats the value as a ordinal value of a number. This function requires the PHP intl extension to be installed. public string asOrdinal ( $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 asNtext()

asNtext() public method Formats the value as an HTML-encoded plain text with newlines converted into breaks. public string asNtext ( $value )$value string The value to be formatted. return string The formatted result.

i18n\Formatter asInteger()

asInteger() public method Formats the value as an integer number by removing any decimal digits without rounding. public string asInteger ( $value, $options = [], $textOptions = [] )$value mixed The value to be formatted. $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 with $numberFormatterTextOptions. return st

i18n\Formatter asImage()

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

i18n\Formatter asHtml()

asHtml() public method Formats the value as HTML text. The value will be purified using yii\helpers\HtmlPurifier to avoid XSS attacks. Use asRaw() if you do not want any purification of the value. public string asHtml ( $value, $config = null )$value string The value to be formatted. $config array|null The configuration for the HTMLPurifier class. return string The formatted result.

i18n\Formatter asEmail()

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

i18n\Formatter asDuration()

asDuration() public method (available since version 2.0.7) Represents the value as duration in human readable format. public string asDuration ( $value, $implodeString = ', ', $negativeSign = '-' )$value DateInterval|string|integer The value to be formatted. Acceptable formats: DateInterval object integer - number of seconds. For example: value 131 represents 2 minutes, 11 seconds ISO8601 duration format. For example, all of these values represent 1 day, 2 hours, 30 minutes duration: