gplcart / country_flag
添加国家图标
dev-master
2018-03-10 20:37 UTC
Requires
- assets/flag-icon-css: 2.8.0
- gplcart/composer-module-installer: ^1
This package is not auto-updated.
Last update: 2024-09-29 04:31:20 UTC
README
国家旗帜是GPL Cart的一个模块,它以SVG格式添加了一组国家旗帜(见https://github.com/lipis/flag-icon-css)。
图标会自动添加到国家数据数组中
// Single item
$country = \gplcart\core\models\Country::get($code);
if(!empty($country['image])){
print_r($country['image]);
}
// Lists
$countries = \gplcart\core\models\Country::getList();
foreach($countries as $country){
if(!empty($country['image])){
print_r($country['image]);
}
}
要手动获取它们,请调用\gplcart\modules\country_flag\CountryFlag::getFlagImages()
安装
此模块需要下载第三方库,应单独下载。您必须使用Composer下载所有依赖项。
- 从您的网站根目录:
composer require gplcart/country_flag。如果模块已下载并手动放置到system/modules中,运行composer update以确保所有第三方文件都位于vendor目录中。 - 转到
admin/module/list启用该模块