domprojects/codeigniter4-country
最新稳定版本:v1.0.1
Composer 安装命令:
composer require domprojects/codeigniter4-country
包简介
Translated country helper for CodeIgniter 4 projects.
README 文档
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
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-02