pessek/hypecountries

Countries for Elgg

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:elgg-plugin

v2.1.3 2021-05-28 19:49 UTC

This package is auto-updated.

Last update: 2024-09-29 03:25:58 UTC


README

Elgg 3.0

Country utilities

Features

  • Country info, including name, ISO, ISO-3, ISO numeric, FIPS, TLD, currency code, postal code format and other
  • Country input view

Usage

Country select

echo elgg_view('input/country', array(
	'name' => 'country',
	'value' => 'CZ',
));

List countries

$countries = elgg()->countries->getCountries();
foreach ($countries as $country) {
	/* @var $country \hypeJunction\Country */
	echo "$country->name ($country->iso)";
}

Country info

Get a list of countries with extended details

$fields = array(
	'name',
	'iso',
	'iso3',
	//'iso_numeric',
	//'fips',
	'capital',
	//'area',
	//'population',
	//'continent',
	'tld',
	'currency_code',
	'currency_name',
	'phone_code',
	'postal_code_format',
	'postal_code_regex',
	'languages',
	//'geoname_id',
	'neighbours'
);

// Get a list of countries ordered by currency_code
$countries = elgg_get_country_info($fields, 'currency_code');