hrevert/ht-country-module
Composer 安装命令:
composer require hrevert/ht-country-module
包简介
A Zend Framework 2 module for country and subdivision data.
README 文档
README
A Zend Framework 2 module for country and subdivision data. This module integrates lib-country with Zend Framework 2.
Requirements
Usage
Please read the docs of lib-country first.
Using Services
// From ServiceManager /** @var Phine\Country\Loader\Loader $countryLoader */ $countryLoader = $serviceManager->get('CountryLoader');
Using hydrator strategy
$strategy = new HtCountryModule\Hydrator\Strategy\CountryStrategy; // or $strategy = $serviceManager->get('HtCountryModule\Hydrator\Strategy\CountryStrategy'); /** @var Phine\Country\Country $country */ $country = $strategy->hydrate('US'); echo $strategy->extract($country); // will print US
Using country validator
$validator = new HtCountryModule\Validator\CountryValidator; // or $validator = $serviceManager->get('ValidatorManager')->get('CountryValidator'); var_dump($validator->isValid('asdfasfd')); // bool(false) var_dump($validator->isValid('US')); // bool(true)
Installation
- Add
"hrevert/ht-country-module": "1.0.*"to composer.json and runphp composer.phar update - Register
HtCountryModuleas module inconfig/application.config.php
统计信息
- 总下载量: 50
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-05-30