ibexa

Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

country_list

Summary

Fetches the list of countries specified in the "country.ini" configuration file.

Usage

fetch( 'content', 'country_list',
       hash( [ 'filter', filter, ]
             [ 'value', value    ]  ) )

Parameters

NameTypeDescriptionRequired
filter string The type of filtering. No.
value string The value of the filter. No.

Returns

An array of hashes (see below) or FALSE.

Description

This function returns a structure that contains information about countries which are mentioned in the "country.ini" configuration file. The optional "filter" parameter sets the type of filtering that will be used when the countries are fetched. It can be set to "Name", "Alpha2", "Alpha3" or "IDC". The "value" parameter can be used to set the filter's value. For example, it could be set to "Norway".

Note that the names of the countries are fetched according to the current locale settings.

The function returns an array of hashes. The hashes consist of the following elements:

Key

Type

Description

Name

string

The name of the country (for example “Norway”).

Alpha2

string

The ISO 3166-1 alpha-2 code of the country (for example “NO”).

Alpha3

string

The ISO 3166-1 alpha-3 code of the country (for example “NOR”).

IDC

string

The international dialing code of the country (for example “47”).

Examples

Example 1

{def $all_countries=fetch( 'content', 'country_list' )}
 
{foreach $all_countries as $country}
    {$country.Name} <br />
{/foreach}

Outputs the names of all countries specified in the "country.ini" configuration file or its override.

Example 2

{def $country=fetch( 'content', 'country_list', hash( 'filter', 'Name', 'value', 'Norway' ) )}
 
{$country.Name} : {$country.IDC}

Outputs the country name and international dialing code for Norway.

Julia Shymova (15/06/2007 10:31 am)

Julia Shymova (25/06/2007 9:41 am)

Julia Shymova, Balazs Halasy


Comments

There are no comments.