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


PHP Zend_Locale_Data::_list方法代碼示例

本文整理匯總了PHP中Zend_Locale_Data::_list方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Locale_Data::_list方法的具體用法?PHP Zend_Locale_Data::_list怎麽用?PHP Zend_Locale_Data::_list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Locale_Data的用法示例。


在下文中一共展示了Zend_Locale_Data::_list方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getContent

 /**
  * Read the LDML file, get a single path defined value
  *
  * @param  string $locale
  * @param  string $path
  * @param  string $value
  * @return array of string
  * @access public
  */
 public static function getContent($locale, $path, $value = false)
 {
     self::$_list = array();
     if (empty($locale)) {
         $locale = new Zend_Locale();
     }
     if (!Zend_Locale::isLocale($locale)) {
         throw new Zend_Locale_Exception("Locale ({$locale}) is a unknown locale");
     }
     if ($locale instanceof Zend_Locale) {
         $locale = $locale->toString();
     }
     switch (strtolower($path)) {
         case 'languagelist':
             self::_getFile($locale, '/ldml/localeDisplayNames/languages/language', 'type');
             break;
         case 'language':
             self::_getFile($locale, '/ldml/localeDisplayNames/languages/language[@type=\'' . $value . '\']', 'type');
             break;
         case 'scriptlist':
             self::_getFile($locale, '/ldml/localeDisplayNames/scripts/script', 'type');
             break;
         case 'script':
             self::_getFile($locale, '/ldml/localeDisplayNames/scripts/script[@type=\'' . $value . '\']', 'type');
             break;
         case 'territorylist':
             self::_getFile($locale, '/ldml/localeDisplayNames/territories/territory', 'type');
             break;
         case 'territory':
             self::_getFile($locale, '/ldml/localeDisplayNames/territories/territory[@type=\'' . $value . '\']', 'type');
             break;
         case 'variantlist':
             self::_getFile($locale, '/ldml/localeDisplayNames/variants/variant', 'type');
             break;
         case 'variant':
             self::_getFile($locale, '/ldml/localeDisplayNames/variants/variant[@type=\'' . $value . '\']', 'type');
             break;
         case 'keylist':
             self::_getFile($locale, '/ldml/localeDisplayNames/keys/key', 'type');
             break;
         case 'key':
             self::_getFile($locale, '/ldml/localeDisplayNames/keys/key[@type=\'' . $value . '\']', 'type');
             break;
         case 'typelist':
             self::_getFile($locale, '/ldml/localeDisplayNames/types/type', 'type');
             break;
         case 'type':
             if ($value == 'calendar' or $value == 'collation' or $value == 'currency') {
                 self::_getFile($locale, '/ldml/localeDisplayNames/types/type[@key=\'' . $value . '\']', 'type');
             } else {
                 self::_getFile($locale, '/ldml/localeDisplayNames/types/type[@type=\'' . $value . '\']', 'type');
             }
             break;
         case 'orientation':
             self::_getFile($locale, '/ldml/layout/orientation', 'lines', 'lines');
             self::_getFile($locale, '/ldml/layout/orientation', 'characters', 'characters');
             break;
         case 'casing':
             self::_getFile($locale, '/ldml/layout/inList', 'casing', 'casing');
             break;
         case 'characters':
             self::_getFile($locale, '/ldml/characters/exemplarCharacters');
             break;
         case 'delimiters':
             self::_getFile($locale, '/ldml/delimiters/quotationStart', '', 'quoteStart');
             self::_getFile($locale, '/ldml/delimiters/quotationEnd', '', 'quoteEnd');
             self::_getFile($locale, '/ldml/delimiters/alternateQuotationStart', '', 'quoteStartAlt');
             self::_getFile($locale, '/ldml/delimiters/alternateQuotationEnd', '', 'quoteEndAlt');
             break;
         case 'measurement':
             self::_getFile($locale, '/ldml/measurement/measurementSystem', 'type', 'measurement');
             break;
         case 'papersize':
             self::_getFile($locale, '/ldml/measurement/paperSize/height', '', 'height');
             self::_getFile($locale, '/ldml/measurement/paperSize/width', '', 'width');
             break;
         case 'datechars':
             self::_getFile($locale, '/ldml/dates/localizedPatternChars', '', 'chars');
             break;
         case 'defcalendarformat':
             self::_getFile($locale, '/ldml/dates/calendars/default', 'type', 'default');
             break;
         case 'defmonthformat':
             self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/default', 'type', 'default');
             break;
         case 'monthlist':
             self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/months/monthContext[@type=\'' . $value[1] . '\']/monthWidth[@type=\'' . $value[2] . '\']/month', 'type');
             break;
         case 'month':
             self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/months/monthContext[@type=\'' . $value[1] . '\']/monthWidth[@type=\'' . $value[2] . '\']/month[@type=\'' . $value[3] . '\']', 'type');
             break;
//.........這裏部分代碼省略.........
開發者ID:vojtajina,項目名稱:sitellite,代碼行數:101,代碼來源:Data.php


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