sun/country
最新稳定版本:v1.3
Composer 安装命令:
composer require sun/country
包简介
Sun Country is the package that helps you to get the country name & dialing code by the country ISO 3166-1 Alpha-2 code.
关键字:
README 文档
README
Sun Country is the package that helps you to get country name and dialing code by the country ISO 3166-1 Alpha-2 code.
Installation Process
Just copy Country folder somewhere into your project directory. Then include Sun Country autoload file.
require_once('/path/to/Country/autoload.php');
Sun Country is also available via Composer/Packagist.
composer require sun/country
Basic Uses
Get all countries name and dialing code
$country = new Sun\Country; $country->get();
Get a country name and dialing code
$country = new Sun\Country; $country->get('BD');
Get multiple countries name and dialing code
$country = new Sun\Country; $country->get(['BD', 'US']);
Get a country name and dialing code using Alpha 2 code as property
$country = new Sun\Country; $country->bd;
Get a country name
$country = new Sun\Country; $country->getName('BD');
Get a country dialing code
$country = new Sun\Country; $country->getDialingCode('BD');
Get a country name using country geo ip address
$country = new Sun\Country; $country->getCountryNameByGeoIp('203.202.251.42');
Integration In Laravel Framework
Add the ServiceProvider to the providers array in config/app.php
Sun\Provider\CountryServiceProvider::class,
Add the facade to the aliases array in config/app.php
'Country' => Sun\Facade\CountryFacade::class,
Integration In Planet Framework
Add the provider in the config/provider.php file.
Sun\Provider\CountryProvider::class,
Add the alien in the config/alien.php file.
'Country' => Sun\Alien\CountryAlien::class,
License
This package is licensed under the MIT License
统计信息
- 总下载量: 16.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-11