omisai/php-continents
最新稳定版本:1.1.1
Composer 安装命令:
composer require omisai/php-continents
包简介
PHP package to provide continents
关键字:
README 文档
README
PHP Continents Package
The PHP Continents Package provides a convenient and object-oriented approach to working with continent data. Designed to integrate continent information into any PHP applications with ease. This package offers easy access to continent names, non-standardized alpha-2 codes and UN M.49 numeric codes. Eventually, more detailed geographical data is coming like subregions and extra locales.
Features
- Easy retrieval of continent names and codes.
- Object-Oriented Programming (OOP) approach for better data management and integration.
- Lightweight and simple to integrate into any PHP project. (8.1+)
- Currently supporting English, Hungarian, German, Spanish, Italian and French languages.
- Future support for subregions and multiple locales, making it versatile for international applications.
Installation
The PHP Continents Package can be easily installed via Composer.
composer require omisai/php-continents
Usage
After installing the package, you can begin to work with continent data. You can work with any continent model or access all of them through a Collection.
/** * Access through the Collection * * Consider using the Collection class, if you * plan to register it to a service container. * It eagerly loads all the continents. */ use Omisai\Continents\Collection; $collection = new Collection(); $continents = $collection->getContinents(); /** * Shorthand to use the default english locale */ $continents[0]->name; // "Asia" /** * Or using different locale */ $continents[0]->getName('fr'); // "Asie" /** * Search for continent based on alpha-2 code */ $collection->getContinentByCode('OC'); // Omisai\Continents\Models\Oceania /** * Search for continent based on UN M.49 numeric code */ $collection->getContinentByNumeric('010'); // Omisai\Continents\Models\Antarctica /** * Use any continent directly */ use Omisai\Continents\Models\Europe; $europe = new Europe(); $europe->numeric; // "150" $europe->code; // "EU"
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Testing
./vendor/bin/pest # or composer test
Security
If you discover any security-related issues, please email security@omisai.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-27