當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Locale::getCountryTranslationList方法代碼示例

本文整理匯總了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']);
 }
開發者ID:jon9872,項目名稱:zend-framework,代碼行數:12,代碼來源:LocaleTest.php

示例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');
開發者ID:kaseya-university,項目名稱:efront,代碼行數:31,代碼來源:generate-document.php

示例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');
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:12,代碼來源:LocaleTest.php

示例4: getCountryOptionList

 /**
  * Get the countries list generated using Zend_Locale
  * 
  * @return array $key=>$value 
  */
 public function getCountryOptionList()
 {
     return Zend_Locale::getCountryTranslationList();
 }
開發者ID:hettema,項目名稱:Stages,代碼行數:9,代碼來源:Edit.php


注:本文中的Zend_Locale::getCountryTranslationList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。