Download the PHP package tourze/gb-t-2659 without Composer
On this page you can find all versions of the php package tourze/gb-t-2659. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tourze/gb-t-2659
More information about tourze/gb-t-2659
Files in tourze/gb-t-2659
Download tourze/gb-t-2659
More information about tourze/gb-t-2659
Files in tourze/gb-t-2659
Vendor tourze
Package gb-t-2659
Short Description GB/T 2659 world countries and regions name code
License MIT
Package gb-t-2659
Short Description GB/T 2659 world countries and regions name code
License MIT
Please rate this library. Is it a good library?
Informations about the package gb-t-2659
GB/T 2659
中文
A PHP implementation of GB/T 2659 country and region codes (2-letter) based on PHP 8.1 enums.
Features
- Complete GB/T 2659 implementation: All 249 countries and regions included
- Type-safe enums: Built on PHP 8.1 backed enums for maximum type safety
- Bilingual support: Chinese labels with English documentation
- Form integration: Ready-to-use with dropdown lists and form components
- Extensible: Implements
Labelable,Itemable, andSelectableinterfaces - Utility methods: Lowercase conversion, array transformation, and more
Installation
Requirements:
- PHP >= 8.1
tourze/enum-extrapackage
Install via Composer:
Quick Start
Advanced Usage
Form Integration
Country Filtering
API Reference
Methods
Alpha2Code::cases()- Get all enum casesAlpha2Code::from(string $value)- Create enum from string (throws on invalid)Alpha2Code::tryFrom(string $value)- Create enum from string (returns null on invalid)getLabel()- Get Chinese country nametoLowerCase()- Get lowercase country codetoArray()- Convert to array with value and labeltoSelectItem()- Convert to select item formatgenOptions()- Generate all options for forms
Properties
value- The 2-letter country codename- The enum case name (same as value)
Testing
Run tests with PHPUnit:
Contributing
- Check existing issues and PRs before submitting new ones
- Follow PSR-12 coding standards
- Add tests for new features
- Update documentation when needed
License
The MIT License (MIT). Please see License File for more information.
Changelog
See Git commit history for detailed changelog information.
All versions of gb-t-2659 with dependencies
PHP Build Version
Package Version
Requires
tourze/enum-extra Version
1.0.*
The package tourze/gb-t-2659 contains the following files
Loading the files please wait ...