承接 omisai/php-continents 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

omisai/php-continents

最新稳定版本:v1.2.0

Composer 安装命令:

composer require omisai/php-continents

包简介

PHP package to provide continents

README 文档

README

License Latest Stable Version PHP Version Require Test

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.

Testing

./vendor/bin/pest

# or

composer test

Contributing

Please see CONTRIBUTING.md for details on how to contribute to this project.

Security

Please see SECURITY.md for details on reporting security vulnerabilities.

License

This package is open-sourced software licensed under the MIT license.

Sponsoring

If you find this package useful, please consider sponsoring the development: Sponsoring on GitHub

Your support helps us maintain and improve this open-source project!

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固