本文整理匯總了PHP中Armory::SetLocale方法的典型用法代碼示例。如果您正苦於以下問題:PHP Armory::SetLocale方法的具體用法?PHP Armory::SetLocale怎麽用?PHP Armory::SetLocale使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Armory
的用法示例。
在下文中一共展示了Armory::SetLocale方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
$_SESSION['armoryLocaleId'] = 3;
break;
case 'fr_fr':
case 'frfr':
case 'fr':
$_SESSION['armoryLocale'] = 'fr_fr';
$_SESSION['armoryLocaleId'] = 2;
break;
case 'en_us':
case 'enus':
$_SESSION['armoryLocale'] = 'en_us';
$_SESSION['armoryLocaleId'] = 0;
break;
}
$_locale = isset($_SESSION['armoryLocale']) ? $_SESSION['armoryLocale'] : $armory->GetLocale();
$armory->SetLocale($_locale, $_SESSION['armoryLocaleId']);
if (isset($_SERVER['HTTP_REFERER'])) {
$returnUrl = $_SERVER['HTTP_REFERER'];
} else {
$returnUrl = $_SESSION['last_url'];
}
header('Location: ' . $returnUrl);
}
$_locale = isset($_SESSION['armoryLocale']) ? $_SESSION['armoryLocale'] : $armory->GetLocale();
if (defined('load_characters_class')) {
if (!@(include 'classes/class.characters.php')) {
die('<b>Error:</b> unable to load characters class!');
}
$characters = new Characters($armory);
}
if (defined('load_guilds_class')) {
示例2: isset
$_SESSION['armoryLocaleId'] = 3;
break;
case 'fr_fr':
case 'frfr':
case 'fr':
$_SESSION['armoryLocale'] = 'fr_fr';
$_SESSION['armoryLocaleId'] = 2;
break;
case 'en_us':
case 'enus':
$_SESSION['armoryLocale'] = 'en_us';
$_SESSION['armoryLocaleId'] = 0;
break;
}
$_locale = isset($_SESSION['armoryLocale']) ? $_SESSION['armoryLocale'] : Armory::GetLocale();
Armory::SetLocale($_locale, $_SESSION['armoryLocaleId']);
if (isset($_SERVER['HTTP_REFERER'])) {
$returnUrl = $_SERVER['HTTP_REFERER'];
} else {
$returnUrl = $_SESSION['last_url'];
}
header('Location: ' . $returnUrl);
exit;
}
$_locale = isset($_SESSION['armoryLocale']) ? $_SESSION['armoryLocale'] : Armory::GetLocale();
if (defined('load_characters_class')) {
if (!(include __ARMORYDIRECTORY__ . '/includes/classes/class.characters.php')) {
die('<b>Error:</b> unable to load characters class!');
}
$characters = new Characters();
}