Class CLocalizedFormatter
CLocalizedFormatter provides a set of commonly used data formatting methods based on the current locale settings.
It provides the same functionality as CFormatter
, but overrides all
the settings for CFormatter::$booleanFormat
, CFormatter::$datetimeFormat
and CFormatter::$numberFormat
with the values for the current locale. Because of this you are
not able to configure these properties for CLocalizedFormatter directly. Date
and time format can be adjusted by setting CLocalizedFormatter::$dateFormat
and CLocalizedFormatter::$timeFormat
.
It uses CApplication::locale by default but you can set a custom
locale by using CLocalizedFormatter::setLocale()
-method.
For a list of recognizable format types, and details on how to call the
formatter methods, see CFormatter
documentation.
To replace the application component 'format', which is registered by CApplication
by default, you can put this in your application 'components'
config:
'format' => array( 'class' => 'CLocalizedFormatter', ),
- CComponent
- CApplicationComponent implements IApplicationComponent
- CFormatter
- CLocalizedFormatter
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Carsten Brandt <mail@cebe.cc>
Since: 1.1.14
Located at x2engine/framework/utils/CLocalizedFormatter.php
public
|
|
public
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
#
formatDatetime( mixed $value )
Formats the value as a date and time using the locales date formatter. |
public
string
|
__call(),
format(),
formatEmail(),
formatHtml(),
formatImage(),
formatNtext(),
formatRaw(),
formatSize(),
formatText(),
formatUrl(),
getHtmlPurifier(),
normalizeDateValue()
|
getIsInitialized(),
init()
|
public
string
|
$dateFormat | 'medium' |
#
the width of the date pattern. It can be 'full', 'long', 'medium' and 'short'. Defaults to 'medium'. |
public
string
|
$timeFormat | 'medium' |
#
the width of the time pattern. It can be 'full', 'long', 'medium' and 'short'. Defaults to 'medium'. |
$booleanFormat,
$datetimeFormat,
$htmlPurifierOptions,
$numberFormat,
$sizeFormat
|
$behaviors
|
$htmlPurifier
|
$isInitialized
|