Download the PHP package tourze/gb-t-12406 without Composer
On this page you can find all versions of the php package tourze/gb-t-12406. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package gb-t-12406
GB/T 12406
中文
A PHP package that implements the GB/T 12406 standard for currency codes, based on PHP 8.1+ enum, providing type-safe and convenient currency code handling.
Features
- Complete GB/T 12406 Implementation: All 285 international currency codes
- Type-safe PHP 8.1+ Enum: Full IDE autocompletion and type safety
- Multilingual Labels: Chinese names for all currency codes
- Flexible Data Export: Multiple format support (array, select options)
- Dynamic Configuration: Environment-based option filtering
- Historical Currency Support: Includes deprecated currencies (DEM, FRF, etc.)
- Framework Agnostic: Works with any PHP framework or standalone
Installation
Requirements:
- PHP 8.1 or above
- Dependency:
tourze/enum-extra>= 0.0.5
Install via Composer:
Quick Start
API Reference
Basic Methods
getLabel(): string- Get Chinese name of the currencytoArray(): array- Convert to simple key-value arraytoSelectItem(): array- Convert to select option with multiple aliasesCurrency::cases(): array- Get all available currency enumsCurrency::from(string $value): Currency- Create enum from currency codeCurrency::tryFrom(string $value): ?Currency- Safe creation, returns null if invalid
Advanced Features
Generate Options List
Dynamic Option Filtering
Common Currency Examples
Extended Features
This package relies on tourze/enum-extra for:
Labelableinterface for label supportItemableinterface for array conversionSelectableinterface for option generation- Dynamic configuration via environment variables
Contributing
Feel free to submit issues and PRs. Please follow PSR standards and ensure tests pass with PHPUnit before submitting.
License
MIT License © tourze
Changelog
See [CHANGELOG.md] or git history for details.
All versions of gb-t-12406 with dependencies
PHP Build Version
Package Version
Requires
tourze/enum-extra Version
1.0.*
The package tourze/gb-t-12406 contains the following files
Loading the files please wait ...