定制 diggindata/yii2-countrylist 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

diggindata/yii2-countrylist

Composer 安装命令:

composer require diggindata/yii2-countrylist

包简介

Extension to provide a translated list of country names with country codes for the Yii framework

README 文档

README

Country List Extension for Yii 2


This package is based on umpirsky/country-list

It contains an extension for the Yii framework to get a translated list of country names.

Latest Stable Version Total Downloads

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist diggindata/yii2-countrylist "*"

or add

"diggindata/yii2-countrylist": "*"

to the require section of your composer.json.

Then run composer install or composer update.

Usage

The extension looks at the configured Yii application language Yii::$app->language. So if the language is configured to e.g. de, it takes the corresponding translation list from the umpirsky package.

Once the extension is installed, simply use the list in your forms as follows:

use diggindata\countrylist\CountryList;    
<?= $form->field($model, 'countryCode')->dropDownList(CountryList::getList()) ?>

Alternatively, you may add the extension as an application component.

Add the following to your config/web.php file:

...
'components' => [
    'countryList' => [
        'class' => 'diggindata\countrylist\CountryList',
    ],

You can the use it like this:

<?= $form->field($model, 'countryCode')->dropDownList(Yii::$app->countryList->getList()) ?>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-11-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固