Browse Source

Fixed Formatter doc.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
5ecb5e3bd0
  1. 38
      framework/yii/i18n/Formatter.php

38
framework/yii/i18n/Formatter.php

@ -30,19 +30,28 @@ class Formatter extends \yii\base\Formatter
*/ */
public $locale; public $locale;
/** /**
* @var string the default format string to be used to format a date using PHP date() function. * @var string the default format string to be used to format a date.
* This can be "short", "medium", "long", or "full", which represents a preset format of different lengths.
* It can also be a custom format as specified in the [ICU manual](http://userguide.icu-project.org/formatparse/datetime).
*/ */
public $dateFormat = 'short'; public $dateFormat = 'short';
/** /**
* @var string the default format string to be used to format a time using PHP date() function. * @var string the default format string to be used to format a time.
* This can be "short", "medium", "long", or "full", which represents a preset format of different lengths.
* It can also be a custom format as specified in the [ICU manual](http://userguide.icu-project.org/formatparse/datetime).
*/ */
public $timeFormat = 'short'; public $timeFormat = 'short';
/** /**
* @var string the default format string to be used to format a date and time using PHP date() function. * @var string the default format string to be used to format a date and time.
* This can be "short", "medium", "long", or "full", which represents a preset format of different lengths.
* It can also be a custom format as specified in the [ICU manual](http://userguide.icu-project.org/formatparse/datetime).
*/ */
public $datetimeFormat = 'short'; public $datetimeFormat = 'short';
/** /**
* @var array the options to be set for the NumberFormatter objects. Please refer to * @var array the options to be set for the NumberFormatter objects. Please refer to
* [PHP manual](http://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants.unumberformatattribute)
* for the possible options. This property is used by [[createNumberFormatter]] when
* creating a new number formatter to format decimals, currencies, etc.
*/ */
public $numberFormatOptions = array(); public $numberFormatOptions = array();
@ -81,8 +90,11 @@ class Formatter extends \yii\base\Formatter
* - a PHP DateTime object * - a PHP DateTime object
* *
* @param string $format the format used to convert the value into a date string. * @param string $format the format used to convert the value into a date string.
* If null, [[dateFormat]] will be used. The format string should be the one * If null, [[dateFormat]] will be used.
* that can be recognized by the PHP `date()` function. *
* This can be "short", "medium", "long", or "full", which represents a preset format of different lengths.
* It can also be a custom format as specified in the [ICU manual](http://userguide.icu-project.org/formatparse/datetime).
*
* @return string the formatted result * @return string the formatted result
* @see dateFormat * @see dateFormat
*/ */
@ -111,8 +123,11 @@ class Formatter extends \yii\base\Formatter
* - a PHP DateTime object * - a PHP DateTime object
* *
* @param string $format the format used to convert the value into a date string. * @param string $format the format used to convert the value into a date string.
* If null, [[dateFormat]] will be used. The format string should be the one * If null, [[dateFormat]] will be used.
* that can be recognized by the PHP `date()` function. *
* This can be "short", "medium", "long", or "full", which represents a preset format of different lengths.
* It can also be a custom format as specified in the [ICU manual](http://userguide.icu-project.org/formatparse/datetime).
*
* @return string the formatted result * @return string the formatted result
* @see timeFormat * @see timeFormat
*/ */
@ -141,8 +156,11 @@ class Formatter extends \yii\base\Formatter
* - a PHP DateTime object * - a PHP DateTime object
* *
* @param string $format the format used to convert the value into a date string. * @param string $format the format used to convert the value into a date string.
* If null, [[dateFormat]] will be used. The format string should be the one * If null, [[dateFormat]] will be used.
* that can be recognized by the PHP `date()` function. *
* This can be "short", "medium", "long", or "full", which represents a preset format of different lengths.
* It can also be a custom format as specified in the [ICU manual](http://userguide.icu-project.org/formatparse/datetime).
*
* @return string the formatted result * @return string the formatted result
* @see datetimeFormat * @see datetimeFormat
*/ */
@ -213,7 +231,7 @@ class Formatter extends \yii\base\Formatter
/** /**
* Creates a number formatter based on the given type and format. * Creates a number formatter based on the given type and format.
* @param integer $type the type of the number formatter * @param integer $type the type of the number formatter
* @param string $format the format to be used * @param string $format the format to be used. Please refer to [ICU manual](http://www.icu-project.org/apiref/icu4c/classDecimalFormat.html#_details)
* @return NumberFormatter the created formatter instance * @return NumberFormatter the created formatter instance
*/ */
protected function createNumberFormatter($type, $format) protected function createNumberFormatter($type, $format)

Loading…
Cancel
Save