domprojects / codeigniter4-country
Translated country helper for CodeIgniter 4 projects.
Package info
github.com/domProjects/codeigniter4-country
pkg:composer/domprojects/codeigniter4-country
v1.0.0
2026-04-02 13:55 UTC
Requires
- php: ^8.2
- codeigniter4/framework: ^4.7.2
This package is auto-updated.
Last update: 2026-04-02 13:57:51 UTC
README
Translated country helper for CodeIgniter 4.
This package provides:
- a translated country list
- country name lookup from ISO code
- a ready-to-use country dropdown helper
- list of all countries with names and ISO 3166-1 codes
Installation
composer require domprojects/codeigniter4-country
Usage
Load the helper:
helper('country');
Get the translated country list:
$countries = countryList();
Translate an ISO code:
$name = countryIsoToName('fr');
Render a dropdown:
echo countryDropdown('country', ['class' => 'form-select'], 'FR');
Available Functions
countryList(): arraycountryIsoToName(string $iso): stringcountryDropdown(string $name, array|string $extra = '', array|string $selected = ''): string
Locales
The package currently includes translated country files for:
- English
- French
- German
The helper uses the current CodeIgniter locale automatically through lang().
Additional locales can be added over time.
Package Structure
src/
Helpers/
country_helper.php
Language/
<locale>/
Country.php
Language Source
The language files are based on data from:
License
MIT