本文整理匯總了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();
}