LocaleInfoITA
extends LocaleInfoEurozone
in package
Locale info for Italy; see {@see LocaleInfo}
Table of Contents
Properties
- $auto : mixed
- $currency_decimal : mixed
- $currency_iso : mixed
- $currency_name : mixed
- $currency_symbol : mixed
- $decimal_seperator : mixed
- $group_seperator : mixed
- $line1 : mixed
- $line2 : mixed
- $longdate : mixed
- $phone_code : mixed
- $postcode_name : mixed
- $shortdate : mixed
- $state_list : mixed
- $state_name : mixed
- $time : mixed
- $town_name : mixed
Methods
- auto() : LocaleInfo
- Automatically chooses a locale and returns it
- get() : LocaleInfo
- Returns the LocaleInfo class for the specified country code.
- getCurrencyISO() : string
- Return currency ISO code, eg 'AUD'
- getCurrencyName() : string
- The name of the currency, e.g. 'Dollar' for $
- getParameters() : mixed
- Return the raw parameters of this locale
- getPhoneCode() : string
- Return phone code, eg '213'
- getStateList() : array<string|int, mixed>
- Gets a list of states
- getStateName() : string
- Get the name of a given state by looking it up in the states list
- longdate() : string
- Formats dates in a long format
- moneyFormat() : string
- Formats currency values, similar to the interal {@see number_format} function
- nonNumericStates() : array<string|int, mixed>
- Organises the state list so that it doesn't have numeric keys.
- numberFormat() : string
- Formats numbers, like the interal {@see number_format} function
- outputAddressField() : string
- Generates a single address field for the current locale
- outputAddressFields() : string
- Generates the address fields for the current locale
- outputAddressText() : string
- Returns a string which is a formatted version of the address specified using the provided data.
- shortdate() : string
- Formats dates in a short format
- stateValues() : array<string|int, mixed>
- Extracts only the enterable values from the state list
- time() : string
- Formats times
- validateAddress() : void
- Validate address fields
Properties
$auto
public
static mixed
$auto
$currency_decimal
protected
mixed
$currency_decimal
= 2
$currency_iso
protected
mixed
$currency_iso
= 'EUR'
$currency_name
protected
mixed
$currency_name
= 'Euro'
$currency_symbol
protected
mixed
$currency_symbol
= '€'
$decimal_seperator
protected
mixed
$decimal_seperator
= ','
$group_seperator
protected
mixed
$group_seperator
= '.'
$line1
protected
mixed
$line1
= 'Line 1'
$line2
protected
mixed
$line2
= 'Line 2'
$longdate
protected
mixed
$longdate
= 'D jS M Y'
$phone_code
protected
mixed
$phone_code
= '39'
$postcode_name
protected
mixed
$postcode_name
= 'Postcode'
$shortdate
protected
mixed
$shortdate
= 'j/n/Y'
$state_list
protected
mixed
$state_list
= ['AG' => 'Agrigento', 'AL' => 'Alessandria', 'AN' => 'Ancona', 'AO' => 'Aosta', 'AP' => 'Ascoli Piceno', 'AQ' => 'L\'Aquila', 'AR' => 'Arezzo', 'AT' => 'Asti', 'AV' => 'Avellino', 'BA' => 'Bari', 'BG' => 'Bergamo', 'BI' => 'Biella', 'BL' => 'Belluno', 'BN' => 'Benevento', 'BO' => 'Bologna', 'BR' => 'Brindisi', 'BS' => 'Brescia', 'BT' => 'Barletta-Andria-Trani', 'BZ' => 'Bolzano', 'CA' => 'Cagliari', 'CB' => 'Campobasso', 'CE' => 'Caserta', 'CH' => 'Chieti', 'CI' => 'Carbonia-Iglesias', 'CL' => 'Caltanissetta', 'CN' => 'Cuneo', 'CO' => 'Como', 'CR' => 'Cremona', 'CS' => 'Cosenza', 'CT' => 'Catania', 'CZ' => 'Catanzaro', 'EN' => 'Enna', 'FC' => 'Forlì-Cesena', 'FE' => 'Ferrara', 'FG' => 'Foggia', 'FI' => 'Firenze', 'FM' => 'Fermo', 'FR' => 'Frosinone', 'GE' => 'Genova', 'GO' => 'Gorizia', 'GR' => 'Grosseto', 'IM' => 'Imperia', 'IS' => 'Isernia', 'KR' => 'Crotone', 'LC' => 'Lecco', 'LE' => 'Lecce', 'LI' => 'Livorno', 'LO' => 'Lodi', 'LT' => 'Latina', 'LU' => 'Lucca', 'MB' => 'Monza e Brianza', 'MC' => 'Macerata', 'ME' => 'Messina', 'MI' => 'Milano', 'MN' => 'Mantova', 'MO' => 'Modena', 'MS' => 'Massa-Carrara', 'MT' => 'Matera', 'NA' => 'Napoli', 'NO' => 'Novara', 'NU' => 'Nuoro', 'OG' => 'Ogliastra', 'OR' => 'Oristano', 'OT' => 'Olbia-Tempio', 'PA' => 'Palermo', 'PC' => 'Piacenza', 'PD' => 'Padova', 'PE' => 'Pescara', 'PG' => 'Perugia', 'PI' => 'Pisa', 'PN' => 'Pordenone', 'PO' => 'Prato', 'PR' => 'Parma', 'PT' => 'Pistoia', 'PU' => 'Pesaro e Urbino', 'PV' => 'Pavia', 'PZ' => 'Potenza', 'RA' => 'Ravenna', 'RC' => 'Reggio Calabria', 'RE' => 'Reggio Emilia', 'RG' => 'Ragusa', 'RI' => 'Rieti', 'RM' => 'Roma', 'RN' => 'Rimini', 'RO' => 'Rovigo', 'SA' => 'Salerno', 'SI' => 'Siena', 'SO' => 'Sondrio', 'SP' => 'La Spezia', 'SR' => 'Siracusa', 'SS' => 'Sassari', 'SV' => 'Savona', 'TA' => 'Taranto', 'TE' => 'Teramo', 'TN' => 'Trento', 'TO' => 'Torino', 'TP' => 'Trapani', 'TR' => 'Terni', 'TS' => 'Trieste', 'TV' => 'Treviso', 'UD' => 'Udine', 'VA' => 'Varese', 'VB' => 'Verbano-Cusio-Ossola', 'VC' => 'Vercelli', 'VE' => 'Venezia', 'VI' => 'Vicenza', 'VR' => 'Verona', 'VS' => 'Medio Campidano', 'VT' => 'Viterbo', 'VV' => 'Vibo Valentia']
$state_name
protected
mixed
$state_name
= 'State/Province'
$time
protected
mixed
$time
= 'g:ia'
$town_name
protected
mixed
$town_name
= 'Suburb/Town'
Methods
auto()
Automatically chooses a locale and returns it
public
static auto() : LocaleInfo
Return values
LocaleInfoget()
Returns the LocaleInfo class for the specified country code.
public
static get([string $code = null ]) : LocaleInfo
If no LocaleInfo can be found, a generic version is used.
Parameters
- $code : string = null
-
3-letter country code (ISO 3166-1 alpha-3)
Return values
LocaleInfogetCurrencyISO()
Return currency ISO code, eg 'AUD'
public
getCurrencyISO() : string
Return values
string —eg 'AUD'
getCurrencyName()
The name of the currency, e.g. 'Dollar' for $
public
getCurrencyName() : string
Return values
stringgetParameters()
Return the raw parameters of this locale
public
getParameters() : mixed
getPhoneCode()
Return phone code, eg '213'
public
getPhoneCode() : string
Return values
string —eg '213'
getStateList()
Gets a list of states
public
getStateList() : array<string|int, mixed>
Return values
array<string|int, mixed> —For use with Fb::dropdown
getStateName()
Get the name of a given state by looking it up in the states list
public
getStateName(string $val) : string
Parameters
- $val : string
-
Values stored by the LocaleInfo::outputAddressFields dropdown field
Return values
string —Full name of state, e.g. 'South Australia'
longdate()
Formats dates in a long format
public
longdate(int $timestamp) : string
Parameters
- $timestamp : int
-
Unix timestamp
Return values
stringmoneyFormat()
Formats currency values, similar to the interal {@see number_format} function
public
moneyFormat(int|float $number[, int $precision = null ]) : string
Parameters
- $number : int|float
-
The number to format
- $precision : int = null
-
The number of decimal places to render; if NULL then it's locale-dependent
Return values
stringnonNumericStates()
Organises the state list so that it doesn't have numeric keys.
public
nonNumericStates() : array<string|int, mixed>
The state names become the form field values if state list is a numeric array. This makes it easy to configure a new locate with states/provinces/etc which don't have standard abbreviations.
E.g. ['State 1', 'State 2'] would become: ['State 1' => 'State 1', 'State 2' => 'State 2']
Return values
array<string|int, mixed>numberFormat()
Formats numbers, like the interal {@see number_format} function
public
numberFormat(int|float $number[, int $precision = 0 ]) : string
Parameters
- $number : int|float
-
The number to format
- $precision : int = 0
-
The number of decimal places to render
Return values
stringoutputAddressField()
Generates a single address field for the current locale
public
outputAddressField(string $field[, string $prefix = '' ][, bool $required = false ]) : string
Parameters
- $field : string
-
'street', 'street2', 'town', 'state', or 'postcode'
- $prefix : string = ''
-
Optional prefix, e.g. 'postal_'
- $required : bool = false
-
True if the address as a whole is required, irrespective of the individual field
Return values
stringoutputAddressFields()
Generates the address fields for the current locale
public
outputAddressFields([string $prefix = '' ][, bool $required = false ]) : string
Parameters
- $prefix : string = ''
-
Optional prefix, e.g. 'postal_'
- $required : bool = false
-
True if the address as a whole is required, irrespective of individual fields
Return values
stringoutputAddressText()
Returns a string which is a formatted version of the address specified using the provided data.
public
outputAddressText(array<string|int, mixed>|object $data) : string
The string contains newlines which will need converting to BRs for HTML output
Parameters
- $data : array<string|int, mixed>|object
-
A record from the database required columns: street, town, state, postcode, country
Return values
string —Plaintext
shortdate()
Formats dates in a short format
public
shortdate(int $timestamp) : string
Parameters
- $timestamp : int
-
Unix timestamp
Return values
stringstateValues()
Extracts only the enterable values from the state list
public
stateValues() : array<string|int, mixed>
This should be used for validation.
Return values
array<string|int, mixed>time()
Formats times
public
time(int $timestamp) : string
Parameters
- $timestamp : int
-
Unix timestamp
Return values
stringvalidateAddress()
Validate address fields
public
validateAddress(Validator $valid[, bool $required = false ]) : void
Parameters
- $valid : Validator
-
Validator for the form being processed
- $required : bool = false
-
Are the address fields required?