SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class I18n

Formats data according to local conventions.
This is an easier-to-use helper version of the LocaleInfo set of classes.

To set the locale, set the config param:
   sprout.locale

The default is AUS - Australia

Variables

NameVisibilityDescription
$locale (static) 

Functions

NameVisibilityDescription
addressFieldspublic (static)Returns HTML for address fields
initpublic (static)Set the locale to the default as per the configuration
initJavaScriptpublic (static)Return JavaScript code which initialises the I18n javascript library with the locale parameters
longdatepublic (static)Return a formatted date in a short format (e.g. Mon 3rd Jan 2003)
moneypublic (static)Return a formatted currency value
numberpublic (static)Return a formatted number
setLocalepublic (static)Set the locale to something other than the default
shortdatepublic (static)Return a formatted date in a short format (e.g. 3/1/2003)
timepublic (static)Return a formatted dtime (e.g. 5:30pm)

public addressFields

void I18n::addressFields ( bool $required );

Returns HTML for address fields

public init

void I18n::init ( );

Set the locale to the default as per the configuration

public initJavaScript

string I18n::initJavaScript ( );

Return JavaScript code which initialises the I18n javascript library with the locale parameters

public longdate

unknown I18n::longdate ( [ int $timestamp ] );

Return a formatted date in a short format (e.g. Mon 3rd Jan 2003)

public money

unknown I18n::money ( float $number [, mixed $precision ] );

Return a formatted currency value

public number

unknown I18n::number ( float $number , int $precision );

Return a formatted number

public setLocale

void I18n::setLocale ( string $country );

Set the locale to something other than the default
Useful for multi-currency shopping carts, for example.

public shortdate

unknown I18n::shortdate ( [ int $timestamp ] );

Return a formatted date in a short format (e.g. 3/1/2003)

public time

unknown I18n::time ( [ int $timestamp ] );

Return a formatted dtime (e.g. 5:30pm)