domprojects/codeigniter4-country

Translated country helper for CodeIgniter 4 projects.

Maintainers

Package info

github.com/domProjects/codeigniter4-country

pkg:composer/domprojects/codeigniter4-country

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-04-02 13:55 UTC

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(): array
  • countryIsoToName(string $iso): string
  • countryDropdown(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