本文整理汇总了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;
//.........这里部分代码省略.........