delboy1978uk/country
最新稳定版本:v2.6.0
Composer 安装命令:
composer require delboy1978uk/country
包简介
A PHP library of countries and flags.
README 文档
README
A countries and flags library in PHP.
installation
Install via composer into your project:
composer require delboy1978uk/country
usage
factory
You can call CountryFactory::generate($code) to create a country object
public static function generate(string $id): Country;
entity
public function __toString(); public function getFlag(): string; public function getId(): string; public function getIso(): string; public function getName(): string; public function getNumCode(): int; public function setFlag(string $flag): void; public function setId(string $id): void public function setIso(string $iso): void; public function setName(string $name): void; public function setNumCode(int $numCode): void; public function toArray(): array;
trait
You can use HasCountryTrait to add a country to your object (also works with doctrine)
public function getCountry(): Country; public function setCountry(Country $country): void;
flag image helper
You can call Flag::render($country, $size), where size can be one of tiny, small, medium, or large.
public static function render(Country $country, $size)
统计信息
- 总下载量: 3.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-31