本文整理汇总了PHP中Zend_Locale::getCountryTranslationList方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Locale::getCountryTranslationList方法的具体用法?PHP Zend_Locale::getCountryTranslationList怎么用?PHP Zend_Locale::getCountryTranslationList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Locale
的用法示例。
在下文中一共展示了Zend_Locale::getCountryTranslationList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testgetCountryTranslationList
/**
* test getCountryTranslationList
* expected true
*/
public function testgetCountryTranslationList()
{
$value = new Zend_Locale();
$list = $value->getCountryTranslationList();
$this->assertTrue(is_array($list));
$list = $value->getCountryTranslationList('de');
$this->assertEquals("Vereinigte Staaten", $list['US']);
}
示例2: dirname
<?php
require_once dirname(__FILE__) . '/../../common.php';
// -----------------------------------------------------------------------------
// Get geographical information, based on current IP
try {
$client = new Zend_Http_Client();
$client->setUri('http://ipLocationTools.com/ip_query.php?output=json');
$response = $client->request();
if (200 === $response->getStatus()) {
$geoIp = Zend_Json::decode($response->getBody());
if (isset($geoIp['City']) && strlen($geoIp['City']) > 0) {
$city = $geoIp['City'];
}
if (isset($geoIp['CountryCode']) && strlen($geoIp['CountryCode']) > 0) {
$countryCode = $geoIp['CountryCode'];
$countries = Zend_Locale::getCountryTranslationList(LOCALE);
if (isset($countries[$countryCode])) {
$country = $countries[$countryCode];
}
}
}
} catch (Zend_Http_Client_Exception $e) {
}
// -----------------------------------------------------------------------------
// Generate document
$date = new Zend_Date();
$date->setLocale(LOCALE);
$phpLiveDocx = new Tis_Service_LiveDocx_MailMerge(USERNAME, PASSWORD);
$phpLiveDocx->setLocalTemplate('template.docx');
$phpLiveDocx->assign('software', 'Magic Graphical Compression Suite v1.9');
$phpLiveDocx->assign('licensee', 'Henry Döner-Meyer');
示例3: testgetCountryTranslationList
/**
* test getCountryTranslationList
* expected true
*/
public function testgetCountryTranslationList()
{
$value = new Zend_Locale();
$list = $value->getCountryTranslationList();
$this->assertTrue(is_array($list), 'Region List not returned');
$list = $value->getCountryTranslationList('de');
$this->assertTrue(is_array($list), 'Region List not returned');
}
示例4: getCountryOptionList
/**
* Get the countries list generated using Zend_Locale
*
* @return array $key=>$value
*/
public function getCountryOptionList()
{
return Zend_Locale::getCountryTranslationList();
}