zend-modules/isocodes-country 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

zend-modules/isocodes-country

Composer 安装命令:

composer require zend-modules/isocodes-country

包简介

README 文档

README

Build Status

Installation

  1. Add this project in your composer.json:

    "require": {
        "zend-modules/isocodes-country": "dev-master"
    }
  2. Now tell composer to download isocodes-country by running the command:

    $ php composer.phar update

Adapters

StaticAdapter

The static adapter uses an internal array of country names. This is the default adapter as no extra configuration in needed.

$countryManager = new \IsoCodes\Country\Country();

Pdo

This adapter uses a PDO connection to fetch the data from a database. You have a MySQL dump of the database table in data\iso_3166.sql

$dbh = new \Pdo('mysql:host:localhost;dbname=isodata;', 'root', '');
$adapter = new \IsoCodes\Country\Adapter\Pdo($dbh);
$countryManager = new \IsoCodes\Country\Country($adapter);

You may also pass the PDO::__construct parameters.

$adapter = new \IsoCodes\Country\Adapter\Pdo(array(
    'dsn'      => 'mysql:host:localhost;dbname=isodata;',
    'username' => 'root',
    'password' => ''
));
$countryManager = new \IsoCodes\Country\Country($adapter);

ZendDB

This adapter uses a Zend\Db\Adapter\Adapterinterface object to retrieve country information from a database.

As an example:

$dbAdapter      = $serviceManager->get('Zend\Db\Adapter\Adapter');
$adapter        = new \IsoCodes\Country\Adapter\ZendDB($dbAdapter);
$countryManager = new \IsoCodes\Country\Country($adapter);

Translating

The default output is english.

To change the output locale set the translator's locale to the one that fits your needs. For example, if you wish to output the country names in spanish:

$countryManager->getTranslator()->setLocale('es');

Data Source

The data provided by this module comes from iso-codes package from Debian.

http://pkg-isocodes.alioth.debian.org/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPLv3
  • 更新时间: 2015-10-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固