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


PHP locale::get方法代碼示例

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


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

示例1: array

 * @subpackage dispatcher
 * @category dispatcher
 */
# get page data associated with page

# These common replacements for {templatey} type things in the content. Feature is minimal for speed.
$needles = array (
	'{page}'
);
$haystacks = array (
	config::get('site/htmlRoot') . config::get('site/pagePrefix')
);

if(locale::get() !== 'en')
{
	$langQuery = 'AND `lang` = \''.locale::get().'\'';
}

# We are going to get the extra content from the pagevars.
if (strlen($this->dPage['pageVars']['content']) > 0)
{
	$extraContent = explode(',', $this->dPage['pageVars']['content']);
}
if (is_array($extraContent))
{
	foreach ($extraContent as $k => $v)
	{
		$t = explode('=', $extraContent[$k]);
		$extraContent[$t[0]] = $t[1];
		unset($extraContent[$k]);
		$extraQuery .= ' OR `name` = \'' . $t[1] . '\'';
開發者ID:radiosilence,項目名稱:quickbox,代碼行數:31,代碼來源:standardContent.disp.php

示例2: _L

/**
 * Looks up localized version of provided text matching selected number of items
 * text is referring to.
 *
 * @param string $singular default text to show on single item
 * @param string $plural default text to show on no/multiple items
 * @param integer $count number of items text is considered to refer to
 * @param string $fallbackSingular optional translation to provide on missing (match in) translation table for singular form
 * @param string $fallbackPlural optional translation to provide on missing (match in) translation table for plural form
 * @return string localized version of text or related text in $singular/$plural on mismatch
 */
function _L($singular, $plural = null, $count = 1, $fallbackSingular = null, $fallbackPlural = null)
{
    return locale::get($singular, is_null($plural) ? $singular : $plural, $count, $fallbackSingular, $fallbackPlural);
}
開發者ID:cepharum,項目名稱:txf,代碼行數:15,代碼來源:shortcuts.php


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