Documentation

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

$currency_decimal

protected mixed $currency_decimal = 2

$longdate

protected mixed $longdate = 'D jS M Y'

$postcode_name

protected mixed $postcode_name = 'Postcode'

$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'

$town_name

protected mixed $town_name = 'Suburb/Town'

Methods

get()

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
LocaleInfo

getCurrencyISO()

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
string

getParameters()

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
string

moneyFormat()

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
string

nonNumericStates()

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
string

outputAddressField()

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
string

outputAddressFields()

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
string

outputAddressText()

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
string

stateValues()

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
string

validateAddress()

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?

On this page

Search results