Skip to content
This repository has been archived by the owner. It is now read-only.
Country utilities
PHP JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
classes/hypeJunction
languages
views/default
.gitattributes
.gitignore
Gruntfile.js
README.md
autoloader.php
composer.json
elgg-plugin.php
elgg-services.php
manifest.xml
package.json
release.md
start.php

README.md

hypeCountries

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');
You can’t perform that action at this time.